@mscharley/eslint-config 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +9 -0
- package/CHANGELOG.md +17 -0
- package/LICENSE +1 -1
- package/README.md +0 -1
- package/index.js +1 -1
- package/node.js +23 -0
- package/package.json +9 -8
- package/partials/eslint.js +110 -0
- package/partials/style.js +31 -0
- package/partials/testing.js +36 -0
- package/partials/typescript.js +179 -0
- package/react.js +7 -0
- package/eslint.json +0 -121
- package/node.json +0 -23
- package/prettier.js +0 -6
- package/react.json +0 -7
- package/testing.json +0 -36
- package/typescript.json +0 -187
package/.eslintrc.js
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Change Log - @mscharley/eslint-config
|
|
2
2
|
|
|
3
|
+
## 3.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eb2ff9b: fix(deps): update typescript-eslint monorepo to ^7.1.0
|
|
8
|
+
- 65ca38c: fix(deps): update dependency eslint-plugin-react to ^7.34.0
|
|
9
|
+
- 03682c3: fix(deps): update typescript-eslint monorepo to ^7.1.1
|
|
10
|
+
- 45ab99e: fix(deps): update dependency typescript to v5.4.2
|
|
11
|
+
- ab01fe6: fix(deps): update typescript-eslint monorepo to ^7.2.0
|
|
12
|
+
- 11cf009: fix(deps): replace eslint packages
|
|
13
|
+
- 43822af: fix(deps): update typescript-eslint monorepo to ^7.3.1
|
|
14
|
+
- 6e751eb: fix(deps): update dependency typescript to v5.4.3
|
|
15
|
+
- f701198: fix(deps): update typescript-eslint monorepo to ^7.4.0
|
|
16
|
+
- aa48c87: Migrate to using the stylistic plugin for all style rules instead of the deprecated eslint rules
|
|
17
|
+
- Updated dependencies [aa48c87]
|
|
18
|
+
- @mscharley/prettier-config@3.0.5
|
|
19
|
+
|
|
3
20
|
## 3.1.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/LICENSE
CHANGED
package/README.md
CHANGED
package/index.js
CHANGED
package/node.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['plugin:n/recommended'],
|
|
3
|
+
settings: {
|
|
4
|
+
node: {
|
|
5
|
+
tryExtensions: ['.js', '.jsx', '.json', '.node', '.d.ts', '.ts', '.tsx'],
|
|
6
|
+
},
|
|
7
|
+
},
|
|
8
|
+
rules: {
|
|
9
|
+
'n/no-sync': 'warn',
|
|
10
|
+
'n/no-missing-import': 'off',
|
|
11
|
+
'n/no-missing-require': 'off',
|
|
12
|
+
'n/prefer-promises/dns': 'warn',
|
|
13
|
+
'n/prefer-promises/fs': 'warn',
|
|
14
|
+
},
|
|
15
|
+
overrides: [
|
|
16
|
+
{
|
|
17
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
18
|
+
rules: {
|
|
19
|
+
'n/no-unsupported-features/es-syntax': 'off',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mscharley/eslint-config",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"provenance": true
|
|
6
6
|
},
|
|
7
7
|
"description": "ESLint presets that I use a lot",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "eslint
|
|
9
|
+
"test": "eslint --max-warnings 0 ."
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -27,20 +27,21 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/mscharley/node-presets#readme",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@mscharley/prettier-config": "3.0.
|
|
31
|
-
"@
|
|
32
|
-
"@typescript-eslint/
|
|
30
|
+
"@mscharley/prettier-config": "3.0.5",
|
|
31
|
+
"@stylistic/eslint-plugin": "^1.7.0",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
33
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
33
34
|
"eslint": "^8.57.0",
|
|
34
35
|
"eslint-config-prettier": "^9.1.0",
|
|
35
36
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
36
37
|
"eslint-plugin-deprecation": "^2.0.0",
|
|
37
38
|
"eslint-plugin-import": "^2.29.1",
|
|
38
39
|
"eslint-plugin-jest": "^27.9.0",
|
|
39
|
-
"eslint-plugin-
|
|
40
|
+
"eslint-plugin-n": "^14.0.0",
|
|
40
41
|
"eslint-plugin-prettier": "^5.1.3",
|
|
41
|
-
"eslint-plugin-react": "^7.
|
|
42
|
+
"eslint-plugin-react": "^7.34.1",
|
|
42
43
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
43
44
|
"prettier": "^3.2.5",
|
|
44
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.4.3"
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['eslint:recommended', 'plugin:import/recommended', 'plugin:import/typescript'],
|
|
3
|
+
parser: 'espree',
|
|
4
|
+
env: {
|
|
5
|
+
commonjs: true,
|
|
6
|
+
es6: true,
|
|
7
|
+
es2017: true,
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
'import/first': ['warn'],
|
|
11
|
+
'import/no-cycle': ['error', { ignoreExternal: true }],
|
|
12
|
+
'import/no-duplicates': 'error',
|
|
13
|
+
'import/no-useless-path-segments': ['warn'],
|
|
14
|
+
'array-callback-return': 'error',
|
|
15
|
+
'block-scoped-var': 'warn',
|
|
16
|
+
'complexity': ['warn', { max: 20 }],
|
|
17
|
+
'consistent-return': 'error',
|
|
18
|
+
'curly': ['error', 'all'],
|
|
19
|
+
'default-case': 'error',
|
|
20
|
+
'default-param-last': 'error',
|
|
21
|
+
'dot-notation': 'warn',
|
|
22
|
+
'eqeqeq': ['error', 'always', { null: 'ignore' }],
|
|
23
|
+
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
|
|
24
|
+
'guard-for-in': 'warn',
|
|
25
|
+
'no-alert': 'warn',
|
|
26
|
+
'no-await-in-loop': 'error',
|
|
27
|
+
'no-buffer-constructor': 'error',
|
|
28
|
+
'no-console': 'warn',
|
|
29
|
+
'no-duplicate-imports': 'off',
|
|
30
|
+
'no-eval': 'error',
|
|
31
|
+
'no-extend-native': 'error',
|
|
32
|
+
'no-extra-bind': 'error',
|
|
33
|
+
'no-fallthrough': 'error',
|
|
34
|
+
'no-global-assign': 'error',
|
|
35
|
+
'no-implicit-coercion': 'error',
|
|
36
|
+
'no-implied-eval': 'error',
|
|
37
|
+
'no-iterator': 'error',
|
|
38
|
+
'no-lone-blocks': 'warn',
|
|
39
|
+
'no-lonely-if': 'error',
|
|
40
|
+
'no-loop-func': 'error',
|
|
41
|
+
'no-magic-numbers': [
|
|
42
|
+
'warn',
|
|
43
|
+
{
|
|
44
|
+
enforceConst: false,
|
|
45
|
+
ignore: [0, 1],
|
|
46
|
+
ignoreArrayIndexes: true,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
'no-multi-str': 'error',
|
|
50
|
+
'no-new': 'error',
|
|
51
|
+
'no-new-func': 'error',
|
|
52
|
+
'no-octal': 'error',
|
|
53
|
+
'no-octal-escape': 'error',
|
|
54
|
+
'no-param-reassign': 'error',
|
|
55
|
+
'no-process-exit': 'warn',
|
|
56
|
+
'no-proto': 'error',
|
|
57
|
+
'no-prototype-builtins': 'warn',
|
|
58
|
+
'no-restricted-syntax': [
|
|
59
|
+
'error',
|
|
60
|
+
{
|
|
61
|
+
selector: 'SequenceExpression',
|
|
62
|
+
message: 'The comma operator is confusing and a common mistake. Don’t use it!',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
'no-return-assign': ['error', 'always'],
|
|
66
|
+
'no-return-await': 'error',
|
|
67
|
+
'no-self-compare': 'error',
|
|
68
|
+
'no-shadow': 'error',
|
|
69
|
+
'no-sync': 'error',
|
|
70
|
+
'no-template-curly-in-string': 'warn',
|
|
71
|
+
'no-throw-literal': 'error',
|
|
72
|
+
'no-unexpected-multiline': 'error',
|
|
73
|
+
'no-unused-vars': [
|
|
74
|
+
'warn',
|
|
75
|
+
{
|
|
76
|
+
argsIgnorePattern: '^_',
|
|
77
|
+
varsIgnorePattern: '^_',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
'no-use-before-define': 'error',
|
|
81
|
+
'no-useless-call': 'error',
|
|
82
|
+
'no-useless-computed-key': 'error',
|
|
83
|
+
'no-useless-concat': 'warn',
|
|
84
|
+
'no-useless-constructor': 'error',
|
|
85
|
+
'no-useless-rename': 'error',
|
|
86
|
+
'no-useless-return': 'error',
|
|
87
|
+
'no-var': 'error',
|
|
88
|
+
'no-void': ['error', { allowAsStatement: true }],
|
|
89
|
+
'no-warning-comments': 'warn',
|
|
90
|
+
'prefer-arrow-callback': 'error',
|
|
91
|
+
'prefer-const': 'error',
|
|
92
|
+
'prefer-numeric-literals': 'error',
|
|
93
|
+
'prefer-promise-reject-errors': 'error',
|
|
94
|
+
'prefer-regex-literals': 'error',
|
|
95
|
+
'prefer-rest-params': 'error',
|
|
96
|
+
'prefer-spread': 'error',
|
|
97
|
+
'prefer-template': 'error',
|
|
98
|
+
'require-atomic-updates': 'warn',
|
|
99
|
+
'require-await': 'error',
|
|
100
|
+
'require-unicode-regexp': 'warn',
|
|
101
|
+
'sort-imports': ['warn', { allowSeparatedGroups: true, ignoreCase: true }],
|
|
102
|
+
'symbol-description': 'error',
|
|
103
|
+
},
|
|
104
|
+
settings: {
|
|
105
|
+
'import/resolver': {
|
|
106
|
+
typescript: true,
|
|
107
|
+
node: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const stylistic = require('@stylistic/eslint-plugin');
|
|
2
|
+
|
|
3
|
+
const prettierConfig = require('@mscharley/prettier-config');
|
|
4
|
+
const TAB_WIDTH = 2;
|
|
5
|
+
const customized = stylistic.configs.customize({
|
|
6
|
+
flat: false,
|
|
7
|
+
indent: prettierConfig.useTabs ? 'tab' : TAB_WIDTH,
|
|
8
|
+
quotes: prettierConfig.singleQuote ? 'single' : 'double',
|
|
9
|
+
semi: prettierConfig.semi,
|
|
10
|
+
jsx: true,
|
|
11
|
+
commaDangle: 'always-multiline',
|
|
12
|
+
quoteProps: prettierConfig.quoteProps,
|
|
13
|
+
arrowParens: prettierConfig.arrowParens === 'always',
|
|
14
|
+
braceStyle: '1tbs',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
plugins: ['@stylistic', 'prettier'],
|
|
19
|
+
extends: ['plugin:@stylistic/disable-legacy'],
|
|
20
|
+
rules: {
|
|
21
|
+
'prettier/prettier': ['error', prettierConfig],
|
|
22
|
+
...customized.rules,
|
|
23
|
+
'@stylistic/generator-star-spacing': ['error', 'after'],
|
|
24
|
+
'@stylistic/linebreak-style': ['error', prettierConfig.endOfLine === 'lf' ? 'unix' : 'windows'],
|
|
25
|
+
'@stylistic/quotes': [
|
|
26
|
+
'error',
|
|
27
|
+
customized.rules['@stylistic/quotes'][1],
|
|
28
|
+
{ avoidEscape: true, allowTemplateLiterals: false },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
overrides: [
|
|
3
|
+
{
|
|
4
|
+
// Viteshot support.
|
|
5
|
+
files: ['**/*.screenshot.{jsx,tsx}'],
|
|
6
|
+
rules: {
|
|
7
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
8
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
// Jest support.
|
|
13
|
+
files: [
|
|
14
|
+
'**/__tests__/**/*.{ts,js,tsx,jsx}',
|
|
15
|
+
'**/__mocks__/**/*.{ts,js,tsx,jsx}',
|
|
16
|
+
'**/__utils__/**/*.{ts,js,tsx,jsx}',
|
|
17
|
+
],
|
|
18
|
+
plugins: ['jest'],
|
|
19
|
+
extends: ['plugin:jest/style', 'plugin:jest/recommended'],
|
|
20
|
+
rules: {
|
|
21
|
+
'@typescript-eslint/consistent-type-assertions': 'off',
|
|
22
|
+
'jest/prefer-todo': 'error',
|
|
23
|
+
'jest/no-conditional-in-test': 'warn',
|
|
24
|
+
'jest/no-untyped-mock-factory': 'error',
|
|
25
|
+
'jest/prefer-called-with': 'error',
|
|
26
|
+
'jest/prefer-comparison-matcher': 'warn',
|
|
27
|
+
'jest/prefer-equality-matcher': 'warn',
|
|
28
|
+
'jest/prefer-lowercase-title': 'error',
|
|
29
|
+
'jest/prefer-expect-assertions': [
|
|
30
|
+
'error',
|
|
31
|
+
{ onlyFunctionsWithExpectInLoop: true, onlyFunctionsWithExpectInCallback: true },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
plugins: ['deprecation'],
|
|
3
|
+
rules: {
|
|
4
|
+
'deprecation/deprecation': 'off',
|
|
5
|
+
},
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
extends: ['plugin:@typescript-eslint/recommended'],
|
|
9
|
+
parser: '@typescript-eslint/parser',
|
|
10
|
+
parserOptions: {
|
|
11
|
+
project: './tsconfig.json',
|
|
12
|
+
},
|
|
13
|
+
plugins: ['@typescript-eslint'],
|
|
14
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
15
|
+
rules: {
|
|
16
|
+
'deprecation/deprecation': 'warn',
|
|
17
|
+
'@typescript-eslint/array-type': [
|
|
18
|
+
'error',
|
|
19
|
+
{
|
|
20
|
+
default: 'array-simple',
|
|
21
|
+
readonly: 'generic',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
'@typescript-eslint/class-literal-property-style': ['error', 'fields'],
|
|
25
|
+
'@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
|
|
26
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
27
|
+
'warn',
|
|
28
|
+
{
|
|
29
|
+
assertionStyle: 'as',
|
|
30
|
+
objectLiteralTypeAssertions: 'allow-as-parameter',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
34
|
+
'warn',
|
|
35
|
+
{ prefer: 'type-imports', disallowTypeAnnotations: true },
|
|
36
|
+
],
|
|
37
|
+
'@typescript-eslint/explicit-function-return-type': [
|
|
38
|
+
'warn',
|
|
39
|
+
{
|
|
40
|
+
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
|
|
41
|
+
allowDirectConstAssertionInArrowFunctions: false,
|
|
42
|
+
allowExpressions: false,
|
|
43
|
+
allowHigherOrderFunctions: true,
|
|
44
|
+
allowTypedFunctionExpressions: true,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
'default-param-last': 'off',
|
|
48
|
+
'@typescript-eslint/default-param-last': 'error',
|
|
49
|
+
'@typescript-eslint/explicit-member-accessibility': 'error',
|
|
50
|
+
'@typescript-eslint/explicit-module-boundary-types': [
|
|
51
|
+
'error',
|
|
52
|
+
{
|
|
53
|
+
allowArgumentsExplicitlyTypedAsAny: false,
|
|
54
|
+
allowDirectConstAssertionInArrowFunctions: false,
|
|
55
|
+
allowedNames: [],
|
|
56
|
+
allowHigherOrderFunctions: true,
|
|
57
|
+
allowTypedFunctionExpressions: true,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
'@typescript-eslint/indent': 'off',
|
|
61
|
+
'@typescript-eslint/member-delimiter-style': 'error',
|
|
62
|
+
'@typescript-eslint/method-signature-style': ['error', 'property'],
|
|
63
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
64
|
+
'@typescript-eslint/no-invalid-void-type': 'warn',
|
|
65
|
+
'no-magic-numbers': 'off',
|
|
66
|
+
'no-loop-func': 'off',
|
|
67
|
+
'@typescript-eslint/no-loop-func': 'error',
|
|
68
|
+
'@typescript-eslint/no-magic-numbers': [
|
|
69
|
+
'warn',
|
|
70
|
+
{
|
|
71
|
+
enforceConst: false,
|
|
72
|
+
ignore: [0, 1],
|
|
73
|
+
ignoreArrayIndexes: true,
|
|
74
|
+
ignoreEnums: true,
|
|
75
|
+
ignoreNumericLiteralTypes: true,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
79
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
80
|
+
'no-shadow': 'off',
|
|
81
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
82
|
+
'@typescript-eslint/no-type-alias': [
|
|
83
|
+
'error',
|
|
84
|
+
{
|
|
85
|
+
allowAliases: 'in-unions-and-intersections',
|
|
86
|
+
allowLiterals: 'in-unions-and-intersections',
|
|
87
|
+
allowCallbacks: 'always',
|
|
88
|
+
allowConditionalTypes: 'always',
|
|
89
|
+
allowConstructors: 'always',
|
|
90
|
+
allowMappedTypes: 'always',
|
|
91
|
+
allowTupleTypes: 'always',
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
'no-use-before-define': 'off',
|
|
95
|
+
'@typescript-eslint/no-use-before-define': 'error',
|
|
96
|
+
'no-useless-constructor': 'off',
|
|
97
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
98
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
99
|
+
'@typescript-eslint/prefer-function-type': 'error',
|
|
100
|
+
'@typescript-eslint/quotes': ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
|
|
101
|
+
'@typescript-eslint/unified-signatures': 'warn',
|
|
102
|
+
'@typescript-eslint/await-thenable': 'error',
|
|
103
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
104
|
+
'error',
|
|
105
|
+
{
|
|
106
|
+
'ts-expect-error': 'allow-with-description',
|
|
107
|
+
'ts-ignore': false,
|
|
108
|
+
'ts-nocheck': false,
|
|
109
|
+
'ts-check': true,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
'dot-notation': 'off',
|
|
113
|
+
'@typescript-eslint/dot-notation': 'warn',
|
|
114
|
+
'@typescript-eslint/no-base-to-string': 'error',
|
|
115
|
+
'@typescript-eslint/no-floating-promises': [
|
|
116
|
+
'error',
|
|
117
|
+
{
|
|
118
|
+
ignoreVoid: true,
|
|
119
|
+
ignoreIIFE: false,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
'no-implied-eval': 'off',
|
|
123
|
+
'@typescript-eslint/no-implied-eval': 'error',
|
|
124
|
+
'@typescript-eslint/no-misused-promises': 'error',
|
|
125
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
126
|
+
'no-throw-literal': 'off',
|
|
127
|
+
'@typescript-eslint/no-throw-literal': 'error',
|
|
128
|
+
'no-unused-vars': 'off',
|
|
129
|
+
'@typescript-eslint/no-unused-vars': [
|
|
130
|
+
'warn',
|
|
131
|
+
{
|
|
132
|
+
argsIgnorePattern: '^_',
|
|
133
|
+
varsIgnorePattern: '^_',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': [
|
|
137
|
+
'error',
|
|
138
|
+
{
|
|
139
|
+
allowComparingNullableBooleansToTrue: true,
|
|
140
|
+
allowComparingNullableBooleansToFalse: true,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
144
|
+
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
145
|
+
'@typescript-eslint/no-unsafe-call': 'error',
|
|
146
|
+
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
147
|
+
'@typescript-eslint/no-unsafe-return': 'error',
|
|
148
|
+
'@typescript-eslint/no-var-requires': 'error',
|
|
149
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
150
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
151
|
+
'@typescript-eslint/prefer-readonly': 'warn',
|
|
152
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
|
|
153
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
154
|
+
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
155
|
+
'@typescript-eslint/promise-function-async': 'error',
|
|
156
|
+
'require-await': 'off',
|
|
157
|
+
'@typescript-eslint/require-await': 'error',
|
|
158
|
+
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
159
|
+
'no-return-await': 'off',
|
|
160
|
+
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
161
|
+
'@typescript-eslint/strict-boolean-expressions': [
|
|
162
|
+
'error',
|
|
163
|
+
{
|
|
164
|
+
allowString: false,
|
|
165
|
+
allowNumber: false,
|
|
166
|
+
allowNullableObject: false,
|
|
167
|
+
allowNullableBoolean: false,
|
|
168
|
+
allowNullableString: false,
|
|
169
|
+
allowNullableNumber: false,
|
|
170
|
+
allowAny: false,
|
|
171
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
'@typescript-eslint/unbound-method': 'error',
|
|
175
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
};
|
package/react.js
ADDED
package/eslint.json
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["eslint:recommended", "./prettier", "plugin:import/recommended", "plugin:import/typescript"],
|
|
3
|
-
"parser": "espree",
|
|
4
|
-
"env": {
|
|
5
|
-
"commonjs": true,
|
|
6
|
-
"es6": true,
|
|
7
|
-
"es2017": true
|
|
8
|
-
},
|
|
9
|
-
"rules": {
|
|
10
|
-
"import/first": ["warn"],
|
|
11
|
-
"import/no-cycle": ["error", { "ignoreExternal": true }],
|
|
12
|
-
"import/no-duplicates": "error",
|
|
13
|
-
"import/no-useless-path-segments": ["warn"],
|
|
14
|
-
"array-callback-return": "error",
|
|
15
|
-
"arrow-spacing": "error",
|
|
16
|
-
"block-scoped-var": "warn",
|
|
17
|
-
"complexity": ["warn", { "max": 20 }],
|
|
18
|
-
"consistent-return": "error",
|
|
19
|
-
"curly": ["error", "all"],
|
|
20
|
-
"default-case": "error",
|
|
21
|
-
"default-param-last": "error",
|
|
22
|
-
"dot-location": ["error", "property"],
|
|
23
|
-
"dot-notation": "warn",
|
|
24
|
-
"eol-last": "error",
|
|
25
|
-
"eqeqeq": ["error", "always", { "null": "ignore" }],
|
|
26
|
-
"generator-star-spacing": ["error", "after"],
|
|
27
|
-
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
28
|
-
"guard-for-in": "warn",
|
|
29
|
-
"indent": "off",
|
|
30
|
-
"jsx-quotes": ["warn", "prefer-single"],
|
|
31
|
-
"linebreak-style": ["error", "unix"],
|
|
32
|
-
"no-alert": "warn",
|
|
33
|
-
"no-await-in-loop": "error",
|
|
34
|
-
"no-buffer-constructor": "error",
|
|
35
|
-
"no-console": "warn",
|
|
36
|
-
"no-duplicate-imports": "off",
|
|
37
|
-
"no-eval": "error",
|
|
38
|
-
"no-extend-native": "error",
|
|
39
|
-
"no-extra-bind": "error",
|
|
40
|
-
"no-fallthrough": "error",
|
|
41
|
-
"no-floating-decimal": "error",
|
|
42
|
-
"no-global-assign": "error",
|
|
43
|
-
"no-implicit-coercion": "error",
|
|
44
|
-
"no-implied-eval": "error",
|
|
45
|
-
"no-iterator": "error",
|
|
46
|
-
"no-lone-blocks": "warn",
|
|
47
|
-
"no-lonely-if": "error",
|
|
48
|
-
"no-loop-func": "error",
|
|
49
|
-
"no-magic-numbers": [
|
|
50
|
-
"warn",
|
|
51
|
-
{
|
|
52
|
-
"enforceConst": false,
|
|
53
|
-
"ignore": [0, 1],
|
|
54
|
-
"ignoreArrayIndexes": true
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
"no-multi-spaces": ["error", { "exceptions": { "VariableDeclarator": true } }],
|
|
58
|
-
"no-multi-str": "error",
|
|
59
|
-
"no-new": "error",
|
|
60
|
-
"no-new-func": "error",
|
|
61
|
-
"no-octal": "error",
|
|
62
|
-
"no-octal-escape": "error",
|
|
63
|
-
"no-param-reassign": "error",
|
|
64
|
-
"no-process-exit": "warn",
|
|
65
|
-
"no-proto": "error",
|
|
66
|
-
"no-prototype-builtins": "warn",
|
|
67
|
-
"no-restricted-syntax": [
|
|
68
|
-
"error",
|
|
69
|
-
{
|
|
70
|
-
"selector": "SequenceExpression",
|
|
71
|
-
"message": "The comma operator is confusing and a common mistake. Don’t use it!"
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
"no-return-assign": ["error", "always"],
|
|
75
|
-
"no-return-await": "error",
|
|
76
|
-
"no-self-compare": "error",
|
|
77
|
-
"no-shadow": "error",
|
|
78
|
-
"no-sync": "error",
|
|
79
|
-
"no-template-curly-in-string": "warn",
|
|
80
|
-
"no-throw-literal": "error",
|
|
81
|
-
"no-unexpected-multiline": "error",
|
|
82
|
-
"no-unused-vars": [
|
|
83
|
-
"warn",
|
|
84
|
-
{
|
|
85
|
-
"argsIgnorePattern": "^_",
|
|
86
|
-
"varsIgnorePattern": "^_"
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
"no-use-before-define": "error",
|
|
90
|
-
"no-useless-call": "error",
|
|
91
|
-
"no-useless-computed-key": "error",
|
|
92
|
-
"no-useless-concat": "warn",
|
|
93
|
-
"no-useless-constructor": "error",
|
|
94
|
-
"no-useless-rename": "error",
|
|
95
|
-
"no-useless-return": "error",
|
|
96
|
-
"no-var": "error",
|
|
97
|
-
"no-void": ["error", { "allowAsStatement": true }],
|
|
98
|
-
"no-warning-comments": "warn",
|
|
99
|
-
"prefer-arrow-callback": "error",
|
|
100
|
-
"prefer-const": "error",
|
|
101
|
-
"prefer-numeric-literals": "error",
|
|
102
|
-
"prefer-promise-reject-errors": "error",
|
|
103
|
-
"prefer-regex-literals": "error",
|
|
104
|
-
"prefer-rest-params": "error",
|
|
105
|
-
"prefer-spread": "error",
|
|
106
|
-
"prefer-template": "error",
|
|
107
|
-
"quotes": ["warn", "single", { "avoidEscape": true, "allowTemplateLiterals": false }],
|
|
108
|
-
"require-atomic-updates": "warn",
|
|
109
|
-
"require-await": "error",
|
|
110
|
-
"require-unicode-regexp": "warn",
|
|
111
|
-
"rest-spread-spacing": ["error", "never"],
|
|
112
|
-
"sort-imports": ["warn", { "allowSeparatedGroups": true, "ignoreCase": true }],
|
|
113
|
-
"symbol-description": "error"
|
|
114
|
-
},
|
|
115
|
-
"settings": {
|
|
116
|
-
"import/resolver": {
|
|
117
|
-
"typescript": true,
|
|
118
|
-
"node": true
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
package/node.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["plugin:node/recommended"],
|
|
3
|
-
"settings": {
|
|
4
|
-
"node": {
|
|
5
|
-
"tryExtensions": [".js", ".jsx", ".json", ".node", ".d.ts", ".ts", ".tsx"]
|
|
6
|
-
}
|
|
7
|
-
},
|
|
8
|
-
"rules": {
|
|
9
|
-
"node/no-sync": "warn",
|
|
10
|
-
"node/no-missing-import": "off",
|
|
11
|
-
"node/no-missing-require": "off",
|
|
12
|
-
"node/prefer-promises/dns": "warn",
|
|
13
|
-
"node/prefer-promises/fs": "warn"
|
|
14
|
-
},
|
|
15
|
-
"overrides": [
|
|
16
|
-
{
|
|
17
|
-
"files": ["**/*.ts", "**/*.tsx"],
|
|
18
|
-
"rules": {
|
|
19
|
-
"node/no-unsupported-features/es-syntax": "off"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
package/prettier.js
DELETED
package/react.json
DELETED
package/testing.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"overrides": [
|
|
3
|
-
{
|
|
4
|
-
// Viteshot support.
|
|
5
|
-
"files": ["**/*.screenshot.{jsx,tsx}"],
|
|
6
|
-
"rules": {
|
|
7
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
8
|
-
"@typescript-eslint/explicit-module-boundary-types": "off"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
// Jest support.
|
|
13
|
-
"files": [
|
|
14
|
-
"**/__tests__/**/*.{ts,js,tsx,jsx}",
|
|
15
|
-
"**/__mocks__/**/*.{ts,js,tsx,jsx}",
|
|
16
|
-
"**/__utils__/**/*.{ts,js,tsx,jsx}"
|
|
17
|
-
],
|
|
18
|
-
"plugins": ["jest"],
|
|
19
|
-
"extends": ["plugin:jest/style", "plugin:jest/recommended"],
|
|
20
|
-
"rules": {
|
|
21
|
-
"@typescript-eslint/consistent-type-assertions": "off",
|
|
22
|
-
"jest/prefer-todo": "error",
|
|
23
|
-
"jest/no-conditional-in-test": "warn",
|
|
24
|
-
"jest/no-untyped-mock-factory": "error",
|
|
25
|
-
"jest/prefer-called-with": "error",
|
|
26
|
-
"jest/prefer-comparison-matcher": "warn",
|
|
27
|
-
"jest/prefer-equality-matcher": "warn",
|
|
28
|
-
"jest/prefer-lowercase-title": "error",
|
|
29
|
-
"jest/prefer-expect-assertions": [
|
|
30
|
-
"error",
|
|
31
|
-
{ "onlyFunctionsWithExpectInLoop": true, "onlyFunctionsWithExpectInCallback": true }
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
package/typescript.json
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"plugins": ["deprecation"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"deprecation/deprecation": "off"
|
|
5
|
-
},
|
|
6
|
-
"overrides": [
|
|
7
|
-
{
|
|
8
|
-
"extends": ["plugin:@typescript-eslint/recommended"],
|
|
9
|
-
"parser": "@typescript-eslint/parser",
|
|
10
|
-
"parserOptions": {
|
|
11
|
-
"project": "./tsconfig.json"
|
|
12
|
-
},
|
|
13
|
-
"plugins": ["@typescript-eslint"],
|
|
14
|
-
"files": ["**/*.ts", "**/*.tsx"],
|
|
15
|
-
"rules": {
|
|
16
|
-
"deprecation/deprecation": "warn",
|
|
17
|
-
"@typescript-eslint/array-type": [
|
|
18
|
-
"error",
|
|
19
|
-
{
|
|
20
|
-
"default": "array-simple",
|
|
21
|
-
"readonly": "generic"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
|
25
|
-
"@typescript-eslint/consistent-indexed-object-style": [
|
|
26
|
-
"error",
|
|
27
|
-
"record"
|
|
28
|
-
],
|
|
29
|
-
"@typescript-eslint/consistent-type-assertions": [
|
|
30
|
-
"warn",
|
|
31
|
-
{
|
|
32
|
-
"assertionStyle": "as",
|
|
33
|
-
"objectLiteralTypeAssertions": "allow-as-parameter"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
37
|
-
"warn",
|
|
38
|
-
{ "prefer": "type-imports", "disallowTypeAnnotations": true }
|
|
39
|
-
],
|
|
40
|
-
"@typescript-eslint/explicit-function-return-type": [
|
|
41
|
-
"warn",
|
|
42
|
-
{
|
|
43
|
-
"allowConciseArrowFunctionExpressionsStartingWithVoid": true,
|
|
44
|
-
"allowDirectConstAssertionInArrowFunctions": false,
|
|
45
|
-
"allowExpressions": false,
|
|
46
|
-
"allowHigherOrderFunctions": true,
|
|
47
|
-
"allowTypedFunctionExpressions": true
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
"default-param-last": "off",
|
|
51
|
-
"@typescript-eslint/default-param-last": "error",
|
|
52
|
-
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
53
|
-
"@typescript-eslint/explicit-module-boundary-types": [
|
|
54
|
-
"error",
|
|
55
|
-
{
|
|
56
|
-
"allowArgumentsExplicitlyTypedAsAny": false,
|
|
57
|
-
"allowDirectConstAssertionInArrowFunctions": false,
|
|
58
|
-
"allowedNames": [],
|
|
59
|
-
"allowHigherOrderFunctions": true,
|
|
60
|
-
"allowTypedFunctionExpressions": true
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"@typescript-eslint/indent": "off",
|
|
64
|
-
"@typescript-eslint/member-delimiter-style": "error",
|
|
65
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
66
|
-
"@typescript-eslint/no-explicit-any": "error",
|
|
67
|
-
"@typescript-eslint/no-invalid-void-type": "warn",
|
|
68
|
-
"no-magic-numbers": "off",
|
|
69
|
-
"no-loop-func": "off",
|
|
70
|
-
"@typescript-eslint/no-loop-func": "error",
|
|
71
|
-
"@typescript-eslint/no-magic-numbers": [
|
|
72
|
-
"warn",
|
|
73
|
-
{
|
|
74
|
-
"enforceConst": false,
|
|
75
|
-
"ignore": [0, 1],
|
|
76
|
-
"ignoreArrayIndexes": true,
|
|
77
|
-
"ignoreEnums": true,
|
|
78
|
-
"ignoreNumericLiteralTypes": true
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
"@typescript-eslint/no-misused-new": "error",
|
|
82
|
-
"@typescript-eslint/no-non-null-assertion": "error",
|
|
83
|
-
"no-shadow": "off",
|
|
84
|
-
"@typescript-eslint/no-shadow": "error",
|
|
85
|
-
"@typescript-eslint/no-type-alias": [
|
|
86
|
-
"error",
|
|
87
|
-
{
|
|
88
|
-
"allowAliases": "in-unions-and-intersections",
|
|
89
|
-
"allowLiterals": "in-unions-and-intersections",
|
|
90
|
-
"allowCallbacks": "always",
|
|
91
|
-
"allowConditionalTypes": "always",
|
|
92
|
-
"allowConstructors": "always",
|
|
93
|
-
"allowMappedTypes": "always",
|
|
94
|
-
"allowTupleTypes": "always"
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
"no-use-before-define": "off",
|
|
98
|
-
"@typescript-eslint/no-use-before-define": "error",
|
|
99
|
-
"no-useless-constructor": "off",
|
|
100
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
|
101
|
-
"@typescript-eslint/prefer-for-of": "error",
|
|
102
|
-
"@typescript-eslint/prefer-function-type": "error",
|
|
103
|
-
"quotes": "off",
|
|
104
|
-
"@typescript-eslint/quotes": [
|
|
105
|
-
"warn",
|
|
106
|
-
"single",
|
|
107
|
-
{ "avoidEscape": true, "allowTemplateLiterals": false }
|
|
108
|
-
],
|
|
109
|
-
"@typescript-eslint/unified-signatures": "warn",
|
|
110
|
-
"@typescript-eslint/await-thenable": "error",
|
|
111
|
-
"@typescript-eslint/ban-ts-comment": [
|
|
112
|
-
"error",
|
|
113
|
-
{
|
|
114
|
-
"ts-expect-error": "allow-with-description",
|
|
115
|
-
"ts-ignore": false,
|
|
116
|
-
"ts-nocheck": false,
|
|
117
|
-
"ts-check": true
|
|
118
|
-
}
|
|
119
|
-
],
|
|
120
|
-
"dot-notation": "off",
|
|
121
|
-
"@typescript-eslint/dot-notation": "warn",
|
|
122
|
-
"@typescript-eslint/no-base-to-string": "error",
|
|
123
|
-
"@typescript-eslint/no-floating-promises": [
|
|
124
|
-
"error",
|
|
125
|
-
{
|
|
126
|
-
"ignoreVoid": true,
|
|
127
|
-
"ignoreIIFE": false
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"no-implied-eval": "off",
|
|
131
|
-
"@typescript-eslint/no-implied-eval": "error",
|
|
132
|
-
"@typescript-eslint/no-misused-promises": "error",
|
|
133
|
-
"@typescript-eslint/no-require-imports": "error",
|
|
134
|
-
"no-throw-literal": "off",
|
|
135
|
-
"@typescript-eslint/no-throw-literal": "error",
|
|
136
|
-
"no-unused-vars": "off",
|
|
137
|
-
"@typescript-eslint/no-unused-vars": [
|
|
138
|
-
"warn",
|
|
139
|
-
{
|
|
140
|
-
"argsIgnorePattern": "^_",
|
|
141
|
-
"varsIgnorePattern": "^_"
|
|
142
|
-
}
|
|
143
|
-
],
|
|
144
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare": [
|
|
145
|
-
"error",
|
|
146
|
-
{
|
|
147
|
-
"allowComparingNullableBooleansToTrue": true,
|
|
148
|
-
"allowComparingNullableBooleansToFalse": true
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
152
|
-
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
153
|
-
"@typescript-eslint/no-unsafe-call": "error",
|
|
154
|
-
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
155
|
-
"@typescript-eslint/no-unsafe-return": "error",
|
|
156
|
-
"@typescript-eslint/no-var-requires": "error",
|
|
157
|
-
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
158
|
-
"@typescript-eslint/prefer-optional-chain": "error",
|
|
159
|
-
"@typescript-eslint/prefer-readonly": "warn",
|
|
160
|
-
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
|
|
161
|
-
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
162
|
-
"@typescript-eslint/prefer-ts-expect-error": "warn",
|
|
163
|
-
"@typescript-eslint/promise-function-async": "error",
|
|
164
|
-
"require-await": "off",
|
|
165
|
-
"@typescript-eslint/require-await": "error",
|
|
166
|
-
"@typescript-eslint/restrict-plus-operands": "warn",
|
|
167
|
-
"no-return-await": "off",
|
|
168
|
-
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
169
|
-
"@typescript-eslint/strict-boolean-expressions": [
|
|
170
|
-
"error",
|
|
171
|
-
{
|
|
172
|
-
"allowString": false,
|
|
173
|
-
"allowNumber": false,
|
|
174
|
-
"allowNullableObject": false,
|
|
175
|
-
"allowNullableBoolean": false,
|
|
176
|
-
"allowNullableString": false,
|
|
177
|
-
"allowNullableNumber": false,
|
|
178
|
-
"allowAny": false,
|
|
179
|
-
"allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing": false
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
"@typescript-eslint/unbound-method": "error",
|
|
183
|
-
"@typescript-eslint/switch-exhaustiveness-check": "error"
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
]
|
|
187
|
-
}
|