Skip to content

Commit 555601c

Browse files
authored
Upgrade Typescript, tslint -> eslint (#22)
* Upgrade Typescript, tslint -> eslint * Upgrade Travis dist to focal
1 parent 9558da4 commit 555601c

File tree

16 files changed

+13092
-3689
lines changed

16 files changed

+13092
-3689
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

.eslintrc.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'airbnb-base',
5+
'plugin:import/errors',
6+
'plugin:import/warnings',
7+
'plugin:import/typescript',
8+
],
9+
plugins: ['@typescript-eslint'],
10+
parser: '@typescript-eslint/parser',
11+
rules: {
12+
'import/noUnresolved': 0,
13+
'import/extensions': ['error', 'always', {
14+
ts: 'never',
15+
js: 'never',
16+
}],
17+
},
18+
overrides: [{
19+
files: ['src/**'],
20+
parser: '@typescript-eslint/parser',
21+
parserOptions: {
22+
project: 'tsconfig.json',
23+
sourceType: 'module',
24+
},
25+
extends: [
26+
'airbnb-base-typescript',
27+
],
28+
}, {
29+
// jest
30+
files: [
31+
'test/**/*.ts',
32+
'jest.setup.js',
33+
],
34+
parserOptions: {
35+
project: 'tsconfig.json',
36+
sourceType: 'module',
37+
},
38+
env: {
39+
jest: true,
40+
},
41+
extends: [
42+
'plugin:jest/recommended',
43+
'plugin:jest/style',
44+
],
45+
rules: {
46+
// development dependencies are hoisted to the root
47+
'import/no-extraneous-dependencies': 'off',
48+
'no-console': 'off',
49+
},
50+
}],
51+
};

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
2+
dist: focal
23
node_js:
3-
- 14
4+
- 18
45
cache:
56
directories:
67
- $HOME/.npm

jest.config.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module.exports = {
2-
"transform": {
3-
"^.+\\.tsx?$": "ts-jest"
2+
transform: {
3+
'^.+\\.tsx?$': 'ts-jest',
44
},
5-
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
6-
"moduleFileExtensions": [
7-
"ts",
8-
"tsx",
9-
"js",
10-
"jsx",
11-
"json",
12-
"node"
5+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
6+
moduleFileExtensions: [
7+
'ts',
8+
'tsx',
9+
'js',
10+
'jsx',
11+
'json',
12+
'node',
1313
],
14-
}
14+
};

0 commit comments

Comments
 (0)