@speechanddebate/eslint-config-nsda 1.0.26 → 2.0.0
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/.prettierignore +1 -0
- package/.prettierrc +4 -0
- package/README.md +42 -23
- package/configs/airbnb.js +31 -0
- package/configs/disableTypeChecked.js +6 -0
- package/configs/globals.js +10 -0
- package/configs/ignores.js +10 -0
- package/configs/typescript.js +8 -0
- package/index.js +120 -57
- package/package.json +46 -36
- package/plugins/import.js +23 -0
- package/plugins/importTypescript.js +29 -0
- package/plugins/testingLibrary.js +21 -0
- package/plugins/vitest.js +26 -0
- package/rules/base.js +92 -0
- package/rules/import.js +20 -0
- package/rules/jest.js +7 -0
- package/rules/jsx-a11y.js +18 -0
- package/rules/react.js +62 -0
- package/rules/tabroom.js +41 -0
- package/rules/typescript.js +54 -0
- package/rules/vitest.js +7 -0
- package/jest.js +0 -10
- package/react.js +0 -74
- package/svelte.js +0 -17
- package/tabroom.js +0 -31
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules/
|
package/.prettierrc
ADDED
package/README.md
CHANGED
|
@@ -1,31 +1,50 @@
|
|
|
1
|
-
#
|
|
2
|
-
This package exports the base NSDA eslint config, and a second optional config for React/JSX. The exports respectively extend airbnb-base and airbnb. They require eslint and eslint-plugin-import, along with eslint-plugin-react, eslint-plugin-jsx-a11y, and eslint-plugin-testing-library for the React config.
|
|
1
|
+
# NSDA ESLint Config
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
This package exports multiple NSDA eslint configs comaptible with eslint's flat config format.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
It does not support eslint v9 yet, as too many plugins are not yet compatible.
|
|
6
|
+
|
|
7
|
+
The default export is a base config for use with general JS projects. Or, access different configs with the named export:
|
|
8
|
+
|
|
9
|
+
`{ configs }` - Full eslint configs with plugins/rules/etc...
|
|
10
|
+
|
|
11
|
+
- configs.recommended - Same as the default export
|
|
12
|
+
- configs.react - Base config + React plugins/rules
|
|
13
|
+
- configs.typeChecked - For Typescript projects, also includes React config.
|
|
14
|
+
- configs.tabroom - For use with Tabroom, based on the typeChecked config.
|
|
15
|
+
|
|
16
|
+
You can also use individual named exports to compose a custom config:
|
|
17
|
+
|
|
18
|
+
`{ plugins }` - Individual plugin setups - note that some plugins using the flatCompat utility export arrays instead of objects
|
|
19
|
+
|
|
20
|
+
`{ rules }` - Individual rule sets
|
|
21
|
+
|
|
22
|
+
`{ ignores }` - Ignore/exclusion rules
|
|
23
|
+
|
|
24
|
+
`{ globals }` - Global variable setup
|
|
25
|
+
|
|
26
|
+
To install:
|
|
13
27
|
|
|
14
|
-
Then install the package:
|
|
15
28
|
```
|
|
16
|
-
npm install speechanddebate/eslint-config-nsda --save-dev
|
|
29
|
+
npm install eslint@8.57.0 @speechanddebate/eslint-config-nsda --save-dev
|
|
17
30
|
```
|
|
18
31
|
|
|
19
|
-
Then
|
|
32
|
+
Then use one of the exported configs in your `eslint.config.js`:
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import nsda from '@speechanddebate/eslint-config-nsda';
|
|
36
|
+
export default [
|
|
37
|
+
...nsda,
|
|
38
|
+
{ rules: {} }, // Custom overrides
|
|
39
|
+
];
|
|
20
40
|
```
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
41
|
+
|
|
42
|
+
or
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
import { configs } from '@speechanddebate/eslint-config-nsda';
|
|
46
|
+
export default [
|
|
47
|
+
...configs.typeChecked,
|
|
48
|
+
{ rules: {} }, // Custom overrides
|
|
49
|
+
];
|
|
31
50
|
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
const compat = new FlatCompat({
|
|
9
|
+
baseDirectory: __dirname,
|
|
10
|
+
resolvePluginsRelativeTo: __dirname,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const airbnbBase = compat.config({
|
|
14
|
+
extends: ['airbnb-base'],
|
|
15
|
+
overrides: [
|
|
16
|
+
{
|
|
17
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const airbnbWithReact = compat.config({
|
|
23
|
+
extends: ['airbnb', 'airbnb/hooks'],
|
|
24
|
+
overrides: [
|
|
25
|
+
{
|
|
26
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default null;
|
package/index.js
CHANGED
|
@@ -1,58 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"comma-dangle": ["error", {
|
|
33
|
-
"arrays": "always-multiline",
|
|
34
|
-
"objects": "always-multiline",
|
|
35
|
-
"imports": "always-multiline",
|
|
36
|
-
"exports": "always-multiline",
|
|
37
|
-
"functions": "ignore",
|
|
38
|
-
}],
|
|
39
|
-
"max-len": ["error", 100, 2, {
|
|
40
|
-
ignoreUrls: true,
|
|
41
|
-
ignoreComments: true,
|
|
42
|
-
ignoreRegExpLiterals: true,
|
|
43
|
-
ignoreStrings: true,
|
|
44
|
-
ignoreTemplateLiterals: true,
|
|
45
|
-
}],
|
|
46
|
-
"no-else-return": 1,
|
|
47
|
-
"operator-linebreak": 0,
|
|
48
|
-
"class-methods-use-this": 0,
|
|
49
|
-
"prefer-regex-literals": 0,
|
|
50
|
-
"default-param-last": 0,
|
|
51
|
-
"import/no-named-as-default": 0,
|
|
52
|
-
"import/no-mutable-exports": 0,
|
|
53
|
-
"import/no-extraneous-dependencies": 0,
|
|
54
|
-
"import/no-useless-path-segments": 1,
|
|
55
|
-
"import/no-named-as-default-member": 0,
|
|
56
|
-
"import/extensions": 0,
|
|
57
|
-
}
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
4
|
+
import eslintPluginSvelte from 'eslint-plugin-svelte';
|
|
5
|
+
|
|
6
|
+
import ignores from './configs/ignores.js';
|
|
7
|
+
import globals from './configs/globals.js';
|
|
8
|
+
import { airbnbBase, airbnbWithReact } from './configs/airbnb.js';
|
|
9
|
+
import typescript from './configs/typescript.js';
|
|
10
|
+
import disableTypeChecked from './configs/disableTypeChecked.js';
|
|
11
|
+
|
|
12
|
+
import vitestPlugin from './plugins/vitest.js';
|
|
13
|
+
import testingLibraryPlugin from './plugins/testingLibrary.js';
|
|
14
|
+
import importPlugin from './plugins/import.js';
|
|
15
|
+
import importTypescriptPlugin from './plugins/importTypescript.js';
|
|
16
|
+
|
|
17
|
+
import baseRules from './rules/base.js';
|
|
18
|
+
import importRules from './rules/import.js';
|
|
19
|
+
import reactRules from './rules/react.js';
|
|
20
|
+
import jsxa11yRules from './rules/jsx-a11y.js';
|
|
21
|
+
import jestRules from './rules/jest.js';
|
|
22
|
+
import vitestRules from './rules/vitest.js';
|
|
23
|
+
import typescriptRules from './rules/typescript.js';
|
|
24
|
+
import tabroomRules from './rules/tabroom.js';
|
|
25
|
+
|
|
26
|
+
export const plugins = {
|
|
27
|
+
vitest: vitestPlugin,
|
|
28
|
+
testingLibrary: testingLibraryPlugin,
|
|
29
|
+
import: importPlugin,
|
|
30
|
+
importTypescript: importTypescriptPlugin,
|
|
31
|
+
svelte: eslintPluginSvelte,
|
|
58
32
|
};
|
|
33
|
+
|
|
34
|
+
export const rules = {
|
|
35
|
+
baseRules,
|
|
36
|
+
importRules,
|
|
37
|
+
reactRules,
|
|
38
|
+
jsxa11yRules,
|
|
39
|
+
jestRules,
|
|
40
|
+
vitestRules,
|
|
41
|
+
typescriptRules,
|
|
42
|
+
tabroomRules,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { ignores };
|
|
46
|
+
export { globals };
|
|
47
|
+
|
|
48
|
+
const base = [ignores, globals, eslint.configs.recommended];
|
|
49
|
+
|
|
50
|
+
const recommended = [
|
|
51
|
+
...base,
|
|
52
|
+
...airbnbBase,
|
|
53
|
+
|
|
54
|
+
vitestPlugin,
|
|
55
|
+
importPlugin,
|
|
56
|
+
|
|
57
|
+
baseRules,
|
|
58
|
+
importRules,
|
|
59
|
+
jestRules,
|
|
60
|
+
vitestRules,
|
|
61
|
+
|
|
62
|
+
eslintConfigPrettier,
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const react = [
|
|
66
|
+
...base,
|
|
67
|
+
...airbnbWithReact,
|
|
68
|
+
|
|
69
|
+
vitestPlugin,
|
|
70
|
+
...testingLibraryPlugin,
|
|
71
|
+
importPlugin,
|
|
72
|
+
|
|
73
|
+
baseRules,
|
|
74
|
+
importRules,
|
|
75
|
+
reactRules,
|
|
76
|
+
jsxa11yRules,
|
|
77
|
+
jestRules,
|
|
78
|
+
vitestRules,
|
|
79
|
+
|
|
80
|
+
eslintConfigPrettier,
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const typeChecked = tseslint.config(
|
|
84
|
+
...base,
|
|
85
|
+
|
|
86
|
+
...tseslint.configs.strictTypeChecked,
|
|
87
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
88
|
+
typescript,
|
|
89
|
+
disableTypeChecked,
|
|
90
|
+
|
|
91
|
+
vitestPlugin,
|
|
92
|
+
...testingLibraryPlugin,
|
|
93
|
+
importPlugin,
|
|
94
|
+
...importTypescriptPlugin,
|
|
95
|
+
|
|
96
|
+
baseRules,
|
|
97
|
+
importRules,
|
|
98
|
+
reactRules,
|
|
99
|
+
jsxa11yRules,
|
|
100
|
+
jestRules,
|
|
101
|
+
vitestRules,
|
|
102
|
+
typescriptRules,
|
|
103
|
+
|
|
104
|
+
eslintConfigPrettier,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const tabroom = [
|
|
108
|
+
...typeChecked,
|
|
109
|
+
...eslintPluginSvelte.configs['flat/recommended'],
|
|
110
|
+
...eslintPluginSvelte.configs['flat/prettier'],
|
|
111
|
+
{ ...tabroomRules },
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
export const configs = {
|
|
115
|
+
recommended,
|
|
116
|
+
react,
|
|
117
|
+
typeChecked,
|
|
118
|
+
tabroom,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default recommended;
|
package/package.json
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
2
|
+
"name": "@speechanddebate/eslint-config-nsda",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "NSDA ESLint config",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"format": "prettier . --write",
|
|
9
|
+
"format-check": "prettier . --check"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/speechanddebate/eslint-config-nsda.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"eslint",
|
|
17
|
+
"eslintconfig"
|
|
18
|
+
],
|
|
19
|
+
"author": "Aaron Hardy <aaron.hardy@speechanddebate.org> (https://speechanddebate.org)",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/speechanddebate/eslint-config-nsda/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/speechanddebate/eslint-config-nsda#readme",
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"eslint": "^8.57.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
30
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
31
|
+
"eslint-config-prettier": "^9.1.0",
|
|
32
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
33
|
+
"eslint-plugin-import": "^2.29.1",
|
|
34
|
+
"eslint-plugin-jest": "^28.6.0",
|
|
35
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
36
|
+
"eslint-plugin-react": "^7.34.0",
|
|
37
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
38
|
+
"eslint-plugin-react-refresh": "^0.4.5",
|
|
39
|
+
"eslint-plugin-svelte": "^2.41.0",
|
|
40
|
+
"eslint-plugin-testing-library": "^6.2.0",
|
|
41
|
+
"eslint-plugin-vitest": "^0.3.22",
|
|
42
|
+
"globals": "^15.6.0",
|
|
43
|
+
"typescript-eslint": "^7.13.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"prettier": "^3.2.5"
|
|
47
|
+
}
|
|
38
48
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import importPlugin from 'eslint-plugin-import';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
languageOptions: {
|
|
5
|
+
parserOptions: {
|
|
6
|
+
ecmaVersion: 'latest',
|
|
7
|
+
sourceType: 'module',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
plugins: { import: importPlugin },
|
|
11
|
+
settings: {
|
|
12
|
+
'import/parsers': {
|
|
13
|
+
espree: ['.js', '.cjs', '.mjs', '.jsx'],
|
|
14
|
+
},
|
|
15
|
+
'import/resolver': {
|
|
16
|
+
typescript: true,
|
|
17
|
+
node: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
...importPlugin.configs.recommended.rules,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
const compat = new FlatCompat({
|
|
9
|
+
baseDirectory: __dirname,
|
|
10
|
+
resolvePluginsRelativeTo: __dirname,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default compat.config({
|
|
14
|
+
overrides: [
|
|
15
|
+
{
|
|
16
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
17
|
+
plugins: ['import'],
|
|
18
|
+
extends: ['plugin:import/typescript'],
|
|
19
|
+
settings: {
|
|
20
|
+
'import/parsers': {
|
|
21
|
+
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
22
|
+
},
|
|
23
|
+
'import/resolver': {
|
|
24
|
+
typescript: {},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
const compat = new FlatCompat({
|
|
9
|
+
baseDirectory: __dirname,
|
|
10
|
+
resolvePluginsRelativeTo: __dirname,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default compat.config({
|
|
14
|
+
overrides: [
|
|
15
|
+
{
|
|
16
|
+
files: ['**/*.test.js', '**/*.test.ts', '**/*.test.jsx', '**/*.test.tsx'],
|
|
17
|
+
plugins: ['testing-library'],
|
|
18
|
+
extends: 'plugin:testing-library/react',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import vitest from 'eslint-plugin-vitest';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
files: [
|
|
6
|
+
'**/*.test.js',
|
|
7
|
+
'**/*.test.ts',
|
|
8
|
+
'**/*.test.jsx',
|
|
9
|
+
'**/*.test.tsx',
|
|
10
|
+
'setupTests.js',
|
|
11
|
+
'setupTests.ts',
|
|
12
|
+
'testSetup.js',
|
|
13
|
+
'testSetup.ts',
|
|
14
|
+
],
|
|
15
|
+
plugins: { vitest },
|
|
16
|
+
rules: {
|
|
17
|
+
...vitest.configs.recommended.rules,
|
|
18
|
+
},
|
|
19
|
+
languageOptions: {
|
|
20
|
+
globals: {
|
|
21
|
+
...vitest.environments.env.globals,
|
|
22
|
+
...globals.chai,
|
|
23
|
+
...globals.jest,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
package/rules/base.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
rules: {
|
|
3
|
+
'arrow-body-style': 0,
|
|
4
|
+
// 'arrow-parens': 0,
|
|
5
|
+
// camelcase: [
|
|
6
|
+
// 2,
|
|
7
|
+
// {
|
|
8
|
+
// properties: 'never',
|
|
9
|
+
// allow: [
|
|
10
|
+
// 'UNSAFE_componentWillMount',
|
|
11
|
+
// 'UNSAFE_componentWillReceiveProps',
|
|
12
|
+
// ],
|
|
13
|
+
// },
|
|
14
|
+
// ],
|
|
15
|
+
// 'class-methods-use-this': 0,
|
|
16
|
+
// 'comma-dangle': [
|
|
17
|
+
// 'error',
|
|
18
|
+
// {
|
|
19
|
+
// arrays: 'always-multiline',
|
|
20
|
+
// objects: 'always-multiline',
|
|
21
|
+
// imports: 'always-multiline',
|
|
22
|
+
// exports: 'always-multiline',
|
|
23
|
+
// functions: 'ignore',
|
|
24
|
+
// },
|
|
25
|
+
// ],
|
|
26
|
+
// 'consistent-return': 0,
|
|
27
|
+
// 'default-param-last': 0,
|
|
28
|
+
// 'func-names': 0,
|
|
29
|
+
// 'function-paren-newline': 0,
|
|
30
|
+
// indent: [
|
|
31
|
+
// 2,
|
|
32
|
+
// 4,
|
|
33
|
+
// {
|
|
34
|
+
// SwitchCase: 1,
|
|
35
|
+
// MemberExpression: 'off',
|
|
36
|
+
// flatTernaryExpressions: true,
|
|
37
|
+
// ignoredNodes: ['ConditionalExpression'],
|
|
38
|
+
// },
|
|
39
|
+
// ],
|
|
40
|
+
// 'max-len': [
|
|
41
|
+
// 'error',
|
|
42
|
+
// 100,
|
|
43
|
+
// 2,
|
|
44
|
+
// {
|
|
45
|
+
// ignoreUrls: true,
|
|
46
|
+
// ignoreComments: true,
|
|
47
|
+
// ignoreRegExpLiterals: true,
|
|
48
|
+
// ignoreStrings: true,
|
|
49
|
+
// ignoreTemplateLiterals: true,
|
|
50
|
+
// },
|
|
51
|
+
// ],
|
|
52
|
+
// 'no-buffer-constructor': 0,
|
|
53
|
+
// 'no-console': 0,
|
|
54
|
+
// 'no-else-return': 1,
|
|
55
|
+
// 'no-lonely-if': 0,
|
|
56
|
+
// 'no-param-reassign': 0,
|
|
57
|
+
'no-plusplus': [2, { allowForLoopAfterthoughts: true }],
|
|
58
|
+
// 'no-return-assign': [2, 'except-parens'],
|
|
59
|
+
'no-shadow': [
|
|
60
|
+
2,
|
|
61
|
+
{
|
|
62
|
+
builtinGlobals: false,
|
|
63
|
+
hoist: 'functions',
|
|
64
|
+
allow: [
|
|
65
|
+
'err',
|
|
66
|
+
'error',
|
|
67
|
+
'req',
|
|
68
|
+
'res',
|
|
69
|
+
'request',
|
|
70
|
+
'response',
|
|
71
|
+
'rows',
|
|
72
|
+
'done',
|
|
73
|
+
'next',
|
|
74
|
+
'callback',
|
|
75
|
+
'props',
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
// 'no-underscore-dangle': 0,
|
|
80
|
+
// 'no-unused-vars': [2, { argsIgnorePattern: 'err|rows|req|res|next' }],
|
|
81
|
+
// 'object-curly-newline': 0,
|
|
82
|
+
// 'operator-linebreak': 0,
|
|
83
|
+
// 'prefer-destructuring': 0,
|
|
84
|
+
// 'prefer-regex-literals': 0,
|
|
85
|
+
// quotes: [
|
|
86
|
+
// 2,
|
|
87
|
+
// 'single',
|
|
88
|
+
// { avoidEscape: true, allowTemplateLiterals: true },
|
|
89
|
+
// ],
|
|
90
|
+
radix: [1, 'as-needed'],
|
|
91
|
+
},
|
|
92
|
+
};
|
package/rules/import.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
rules: {
|
|
3
|
+
'import/extensions': [
|
|
4
|
+
2,
|
|
5
|
+
'ignorePackages',
|
|
6
|
+
{
|
|
7
|
+
js: 'never',
|
|
8
|
+
mjs: 'never',
|
|
9
|
+
jsx: 'never',
|
|
10
|
+
ts: 'never',
|
|
11
|
+
tsx: 'never',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
'import/no-extraneous-dependencies': [1, { devDependencies: true }],
|
|
15
|
+
'import/no-mutable-exports': 0,
|
|
16
|
+
'import/no-named-as-default': 0,
|
|
17
|
+
'import/no-named-as-default-member': 0,
|
|
18
|
+
'import/no-useless-path-segments': 1,
|
|
19
|
+
},
|
|
20
|
+
};
|
package/rules/jest.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
rules: {
|
|
3
|
+
// 'jsx-a11y/anchor-is-valid': 0,
|
|
4
|
+
// 'jsx-a11y/click-events-have-key-events': 0,
|
|
5
|
+
// 'jsx-a11y/control-has-associated-label': 0,
|
|
6
|
+
|
|
7
|
+
// Regression in eslint-plugin-jsx-a11y v6.8.0
|
|
8
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/962
|
|
9
|
+
'jsx-a11y/label-has-associated-control': 0,
|
|
10
|
+
|
|
11
|
+
// 'jsx-a11y/label-has-associated-label': 0,
|
|
12
|
+
// 'jsx-a11y/label-has-for': [2, { required: { every: ['id'] } }],
|
|
13
|
+
|
|
14
|
+
// 'jsx-a11y/no-autofocus': 0,
|
|
15
|
+
// 'jsx-a11y/no-noninteractive-element-interactions': 0,
|
|
16
|
+
// 'jsx-a11y/no-static-element-interactions': 0,
|
|
17
|
+
},
|
|
18
|
+
};
|
package/rules/react.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
rules: {
|
|
3
|
+
// 'react/button-has-type': 1,
|
|
4
|
+
// 'react/destructuring-assignment': 0,
|
|
5
|
+
// 'react/forbid-prop-types': 0,
|
|
6
|
+
'react/function-component-definition': [
|
|
7
|
+
2,
|
|
8
|
+
{ namedComponents: 'arrow-function' },
|
|
9
|
+
],
|
|
10
|
+
// 'react/no-access-state-in-setstate': 0,
|
|
11
|
+
// 'react/no-deprecated': 0,
|
|
12
|
+
// 'react/no-did-mount-set-state': 0,
|
|
13
|
+
// 'react/no-unstable-nested-components': [2, { allowAsProps: true }],
|
|
14
|
+
// 'react/no-unused-prop-types': 0,
|
|
15
|
+
// 'react/prefer-stateless-function': [
|
|
16
|
+
// 1,
|
|
17
|
+
// {
|
|
18
|
+
// ignorePureComponents: true,
|
|
19
|
+
// },
|
|
20
|
+
// ],
|
|
21
|
+
// 'react/prop-types': [2, { skipUndeclared: true }],
|
|
22
|
+
'react/react-in-jsx-scope': 0,
|
|
23
|
+
'react/require-default-props': [
|
|
24
|
+
2,
|
|
25
|
+
{
|
|
26
|
+
ignoreFunctionalComponents: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
// 'react/sort-comp': 0,
|
|
30
|
+
|
|
31
|
+
// 'react/jsx-curly-brace-presence': 0,
|
|
32
|
+
// 'react/jsx-curly-newline': [
|
|
33
|
+
// 1,
|
|
34
|
+
// {
|
|
35
|
+
// multiline: 'require',
|
|
36
|
+
// singleline: 'consistent',
|
|
37
|
+
// },
|
|
38
|
+
// ],
|
|
39
|
+
'react/jsx-filename-extension': [
|
|
40
|
+
1,
|
|
41
|
+
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
|
|
42
|
+
],
|
|
43
|
+
// 'react/jsx-indent': [2, 4],
|
|
44
|
+
// 'react/jsx-indent-props': [2, 4],
|
|
45
|
+
// 'react/jsx-no-target-blank': [2, { allowReferrer: true }],
|
|
46
|
+
// 'react/jsx-one-expression-per-line': 0,
|
|
47
|
+
// 'react/jsx-props-no-spreading': 0,
|
|
48
|
+
// 'react/jsx-tag-spacing': 1,
|
|
49
|
+
// 'react/jsx-wrap-multilines': [
|
|
50
|
+
// 1,
|
|
51
|
+
// {
|
|
52
|
+
// declaration: 'parens',
|
|
53
|
+
// assignment: 'parens',
|
|
54
|
+
// return: 'parens',
|
|
55
|
+
// arrow: 'parens',
|
|
56
|
+
// condition: 'ignore',
|
|
57
|
+
// logical: 'ignore',
|
|
58
|
+
// prop: 'ignore',
|
|
59
|
+
// },
|
|
60
|
+
// ],
|
|
61
|
+
},
|
|
62
|
+
};
|
package/rules/tabroom.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
rules: {
|
|
3
|
+
'comma-spacing': 0,
|
|
4
|
+
'global-require': 0,
|
|
5
|
+
'implicit-arrow-linebreak': 0,
|
|
6
|
+
indent: ['error', 'tab'],
|
|
7
|
+
'key-spacing': 0,
|
|
8
|
+
'no-multi-spaces': [
|
|
9
|
+
0,
|
|
10
|
+
{
|
|
11
|
+
exceptions: {
|
|
12
|
+
Property: true,
|
|
13
|
+
VariableDeclarator: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
'no-plusplus': 0,
|
|
18
|
+
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
|
|
19
|
+
'no-tabs': 0,
|
|
20
|
+
'no-use-before-define': 0,
|
|
21
|
+
'padded-blocks': 0,
|
|
22
|
+
'space-before-function-paren': 0,
|
|
23
|
+
'space-in-parens': 0,
|
|
24
|
+
|
|
25
|
+
'import/no-dynamic-require': 0,
|
|
26
|
+
|
|
27
|
+
'react/jsx-equals-spacing': 0,
|
|
28
|
+
'react/jsx-indent': [
|
|
29
|
+
0,
|
|
30
|
+
'tab',
|
|
31
|
+
{
|
|
32
|
+
checkAttributes: false,
|
|
33
|
+
indentLogicalExpressions: true,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
'react/jsx-indent-props': 0,
|
|
37
|
+
'react/no-unknown-property': 0,
|
|
38
|
+
|
|
39
|
+
'jsx-a11y/anchor-has-content': 0,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
// Disable eslint rules that conflict with typescript extension rules
|
|
3
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
4
|
+
rules: {
|
|
5
|
+
'block-spacing': 0,
|
|
6
|
+
'brace-style': 0,
|
|
7
|
+
'class-methods-use-this': 0,
|
|
8
|
+
'comma-dangle': 0,
|
|
9
|
+
'comma-spacing': 0,
|
|
10
|
+
'consistent-return': 0,
|
|
11
|
+
'default-param-last': 0,
|
|
12
|
+
'dot-notation': 0,
|
|
13
|
+
'func-call-spacing': 0,
|
|
14
|
+
indent: 0,
|
|
15
|
+
'init-declarations': 0,
|
|
16
|
+
'key-spacing': 0,
|
|
17
|
+
'keyword-spacing': 0,
|
|
18
|
+
'lines-around-comment': 0,
|
|
19
|
+
'lines-between-class-members': 0,
|
|
20
|
+
'max-params': 0,
|
|
21
|
+
'no-array-constructor': 0,
|
|
22
|
+
'no-dupe-class-members': 0,
|
|
23
|
+
'no-empt-function': 0,
|
|
24
|
+
'no-extra-parens': 0,
|
|
25
|
+
'no-extra-semi': 0,
|
|
26
|
+
'no-implied-eval': 0,
|
|
27
|
+
'no-invalid-this': 0,
|
|
28
|
+
'no-loop-func': 0,
|
|
29
|
+
'no-loss-of-precision': 0,
|
|
30
|
+
'no-magic-numbers': 0,
|
|
31
|
+
'no-redeclare': 0,
|
|
32
|
+
'no-restricted-imports': 0,
|
|
33
|
+
'no-throw-literal': 0,
|
|
34
|
+
'no-unused-expressions': 0,
|
|
35
|
+
'no-unused-vars': 0,
|
|
36
|
+
'no-use-before-define': 0,
|
|
37
|
+
'no-useless-constructor': 0,
|
|
38
|
+
'object-curly-spacing': 0,
|
|
39
|
+
'padding-line-between-statements': 0,
|
|
40
|
+
'prefer-destructing': 0,
|
|
41
|
+
'prefer-promise-reject-errors': 0,
|
|
42
|
+
quotes: 0,
|
|
43
|
+
'require-await': 0,
|
|
44
|
+
'return-await': 0,
|
|
45
|
+
semi: 0,
|
|
46
|
+
'space-before-blocks': 0,
|
|
47
|
+
'space-before-function-paren': 0,
|
|
48
|
+
'space-infix-ops': 0,
|
|
49
|
+
|
|
50
|
+
// Typescript specific rules
|
|
51
|
+
'@typescript-eslint/no-floating-promises': [1, { ignoreVoid: true }],
|
|
52
|
+
'no-void': [1, { allowAsStatement: true }],
|
|
53
|
+
},
|
|
54
|
+
};
|
package/rules/vitest.js
ADDED
package/jest.js
DELETED
package/react.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"extends": ["airbnb", "plugin:testing-library/react", "./index.js"],
|
|
3
|
-
"plugins": [
|
|
4
|
-
"import",
|
|
5
|
-
"react",
|
|
6
|
-
"jsx-a11y",
|
|
7
|
-
"testing-library",
|
|
8
|
-
],
|
|
9
|
-
"env": {
|
|
10
|
-
"browser": true,
|
|
11
|
-
"node": true,
|
|
12
|
-
"mocha": true,
|
|
13
|
-
"jest": true,
|
|
14
|
-
},
|
|
15
|
-
"parserOptions": {
|
|
16
|
-
"ecmaVersion": 2022,
|
|
17
|
-
"ecmaFeatures": {
|
|
18
|
-
"jsx": true
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"rules": {
|
|
22
|
-
"react/jsx-indent": [2, 4],
|
|
23
|
-
"react/jsx-indent-props": [2, 4],
|
|
24
|
-
"react/jsx-filename-extension": 0,
|
|
25
|
-
"react/jsx-curly-brace-presence": 0,
|
|
26
|
-
"react/jsx-wrap-multilines": 0,
|
|
27
|
-
"react/sort-comp": 0,
|
|
28
|
-
"react/no-did-mount-set-state": 0,
|
|
29
|
-
"react/no-unused-prop-types": 0,
|
|
30
|
-
"react/prop-types": [2, { "skipUndeclared": true }],
|
|
31
|
-
"react/forbid-prop-types": 0,
|
|
32
|
-
"react/prefer-stateless-function": [1, {
|
|
33
|
-
"ignorePureComponents": true
|
|
34
|
-
}],
|
|
35
|
-
"react/require-default-props": [2, {
|
|
36
|
-
"ignoreFunctionalComponents": true
|
|
37
|
-
}],
|
|
38
|
-
"react/button-has-type": 1,
|
|
39
|
-
"react/jsx-tag-spacing": 1,
|
|
40
|
-
"react/jsx-curly-newline": [1, {
|
|
41
|
-
"multiline": "require",
|
|
42
|
-
"singleline": "consistent"
|
|
43
|
-
}],
|
|
44
|
-
"react/jsx-wrap-multilines": [1, {
|
|
45
|
-
"declaration": "parens",
|
|
46
|
-
"assignment": "parens",
|
|
47
|
-
"return": "parens",
|
|
48
|
-
"arrow": "parens",
|
|
49
|
-
"condition": "ignore",
|
|
50
|
-
"logical": "ignore",
|
|
51
|
-
"prop": "ignore"
|
|
52
|
-
}],
|
|
53
|
-
"react/jsx-no-target-blank": [2, { "allowReferrer": true }],
|
|
54
|
-
"jsx-a11y/no-static-element-interactions": 0,
|
|
55
|
-
"jsx-a11y/no-noninteractive-element-interactions": 0,
|
|
56
|
-
"jsx-a11y/anchor-is-valid": 0,
|
|
57
|
-
"jsx-a11y/click-events-have-key-events": 0,
|
|
58
|
-
"jsx-a11y/no-autofocus": 0,
|
|
59
|
-
"jsx-a11y/label-has-for": [2, {"required": {"every": ["id"]}}],
|
|
60
|
-
"react/function-component-definition": [2, { "namedComponents": "arrow-function" }],
|
|
61
|
-
"react/no-unstable-nested-components": [2, { "allowAsProps": true }],
|
|
62
|
-
|
|
63
|
-
// New rules that are to be kept off
|
|
64
|
-
"react/destructuring-assignment": 0,
|
|
65
|
-
"react/jsx-props-no-spreading": 0,
|
|
66
|
-
"react/jsx-one-expression-per-line": 0,
|
|
67
|
-
"jsx-a11y/label-has-associated-control": 0,
|
|
68
|
-
"jsx-a11y/control-has-associated-label": 0,
|
|
69
|
-
|
|
70
|
-
// New rules to be kept off for an indertiminate amount of time
|
|
71
|
-
"react/no-deprecated": 0,
|
|
72
|
-
"react/no-access-state-in-setstate": 0,
|
|
73
|
-
}
|
|
74
|
-
};
|
package/svelte.js
DELETED
package/tabroom.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"extends": ["airbnb", "./index.js", "./jest.js", "./svelte.js"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"no-tabs" : 0,
|
|
5
|
-
"no-use-before-define" : 0,
|
|
6
|
-
"key-spacing" : 0,
|
|
7
|
-
"comma-spacing" : 0,
|
|
8
|
-
"implicit-arrow-linebreak" : 0,
|
|
9
|
-
"space-before-function-paren" : 0,
|
|
10
|
-
"no-await-in-loop" : 0,
|
|
11
|
-
"space-in-parens" : 0,
|
|
12
|
-
"import/no-dynamic-require" : 0,
|
|
13
|
-
"global-require" : 0,
|
|
14
|
-
"padded-blocks" : 0,
|
|
15
|
-
"no-restricted-syntax" : ["error", "LabeledStatement", "WithStatement"],
|
|
16
|
-
"no-plusplus" : 0,
|
|
17
|
-
"indent": [
|
|
18
|
-
"error",
|
|
19
|
-
"tab"
|
|
20
|
-
],
|
|
21
|
-
"no-multi-spaces": [
|
|
22
|
-
0,
|
|
23
|
-
{
|
|
24
|
-
"exceptions": {
|
|
25
|
-
"Property" : true,
|
|
26
|
-
"VariableDeclarator" : true
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
};
|