Skip to content

Commit f48cd71

Browse files
committed
better lint, prettier, and test setup
1 parent e080a91 commit f48cd71

27 files changed

+12346
-9444
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc.js

+33-46
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,41 @@
11
module.exports = {
2-
extends: ['airbnb', 'plugin:@typescript-eslint/recommended'],
3-
parser: '@typescript-eslint/parser',
4-
plugins: ['@typescript-eslint', 'prettier'],
2+
extends: [
3+
'airbnb-typescript',
4+
'airbnb/hooks',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:jest/recommended',
7+
'plugin:prettier/recommended'
8+
],
9+
plugins: ['react', '@typescript-eslint', 'jest', 'import'],
510
env: {
611
browser: true,
7-
es6: true
12+
es6: true,
13+
jest: true,
814
},
9-
settings: {
10-
'import/parsers': {
11-
'@typescript-eslint/parser': ['.ts', '.tsx'],
12-
},
13-
'import/resolver': {
14-
typescript: {},
15+
globals: {
16+
Atomics: 'readonly',
17+
SharedArrayBuffer: 'readonly',
18+
},
19+
parser: '@typescript-eslint/parser',
20+
parserOptions: {
21+
ecmaFeatures: {
22+
jsx: true,
1523
},
24+
ecmaVersion: 2018,
25+
sourceType: 'module',
26+
project: './tsconfig.json',
1627
},
1728
rules: {
18-
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
19-
'import/no-extraneous-dependencies': [2, { devDependencies: ['**/test.tsx', '**/test.ts'] }],
20-
'import/extensions': [2, {ignorePackages: true}],
21-
'no-nested-ternary': [0],
22-
indent: [2, 4, { "SwitchCase": 1 }],
23-
"arrow-body-style": [1, 'as-needed'],
24-
'no-restricted-globals': [1],
25-
'@typescript-eslint/indent': [2, 4],
26-
'react/jsx-indent': [2, 4],
27-
'react/jsx-tag-spacing': [0],
28-
'@typescript-eslint/ban-ts-ignore': [0],
29-
'import/prefer-default-export': [0],
30-
'react/sort-comp': [0],
31-
"react/destructuring-assignment": [1, "always", { "ignoreClassFields": true }],
32-
'react/static-property-placement': [1, 'property assignment', {
33-
propTypes: "static public field",
34-
defaultProps: "static public field"
35-
}],
36-
'react/state-in-constructor': [0],
37-
'react/jsx-indent-props': [2, 4],
38-
"object-curly-newline": [0],
39-
"object-curly-spacing": [0],
40-
quotes: [2, 'single'],
41-
"comma-dangle": [2, 'never'],
42-
'no-param-reassign': [0],
43-
"max-len": [2, {
44-
code: 150,
45-
comments: 150,
46-
ignoreUrls: true
47-
}],
48-
'react/jsx-props-no-spreading': [2, {
49-
html: 'enforce',
50-
custom: 'ignore',
51-
exceptions: []
52-
}]
29+
'linebreak-style': 'off',
30+
'@typescript-eslint/ban-ts-comment': 'off',
31+
'react-hooks/exhaustive-deps': 1,
32+
'@typescript-eslint/no-shadow': 1,
33+
'@typescript-eslint/naming-convention': 1,
34+
'prettier/prettier': [
35+
'error',
36+
{
37+
endOfLine: 'auto',
38+
},
39+
],
5340
},
54-
};
41+
};

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ lib
55
tools
66
coverage
77
*.tgz
8+
npm-debug.log

jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ module.exports = {
44
],
55
transform: {
66
'^.+\\.tsx?$': 'ts-jest'
7-
}
7+
},
8+
testEnvironment: "jsdom"
89
};

0 commit comments

Comments
 (0)