@speechanddebate/eslint-config-nsda 1.0.26 → 2.0.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.
@@ -0,0 +1 @@
1
+ node_modules/
package/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "useTabs": true,
3
+ "singleQuote": true
4
+ }
package/README.md CHANGED
@@ -1,31 +1,50 @@
1
- # eslint-config-nsda
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
- First install eslint and any plugins:
3
+ This package exports multiple NSDA eslint configs comaptible with eslint's flat config format.
5
4
 
6
- ```
7
- npm install eslint eslint-plugin-import --save-dev
8
- ```
9
- or
10
- ```
11
- npm install eslint eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-testing-library --save-dev
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 extend the relevant packages in your package.json:
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
- "eslintConfig": {
22
- "extends": [
23
- "eslint-config-nsda",
24
- "eslint-config-nsda/react"
25
- ],
26
- "ignorePatterns": [
27
- "build/*",
28
- "coverage/*",
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;
@@ -0,0 +1,6 @@
1
+ import tseslint from 'typescript-eslint';
2
+
3
+ export default {
4
+ files: ['**/*.js', '**/*.jsx'],
5
+ ...tseslint.configs.disableTypeChecked,
6
+ };
@@ -0,0 +1,10 @@
1
+ import globals from 'globals';
2
+
3
+ export default {
4
+ languageOptions: {
5
+ globals: {
6
+ ...globals.browser,
7
+ ...globals.node,
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ ignores: [
3
+ '**/node_modules/**',
4
+ '**/dist/**',
5
+ '**/build/**',
6
+ '**/coverage/**',
7
+ '**/public/**',
8
+ '**/vendor/**',
9
+ ],
10
+ };
@@ -0,0 +1,8 @@
1
+ export default {
2
+ languageOptions: {
3
+ parserOptions: {
4
+ project: ['./tsconfig.json', './tsconfig.node.json'],
5
+ // tsconfigRootDir: import.meta.dirname,
6
+ },
7
+ },
8
+ };
package/index.js CHANGED
@@ -1,58 +1,121 @@
1
- module.exports = {
2
- "extends": "airbnb-base",
3
- "plugins": [
4
- "import",
5
- ],
6
- "env": {
7
- "node": true,
8
- "mocha": true,
9
- "jest": true,
10
- },
11
- "rules": {
12
- "indent": [2, 4, {"SwitchCase": 1, "MemberExpression": "off", "flatTernaryExpressions": true, "ignoredNodes": ["ConditionalExpression"]}],
13
- "quotes": [2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}],
14
- "camelcase": [2, { "properties": "never", "allow": ["UNSAFE_componentWillMount", "UNSAFE_componentWillReceiveProps"] }],
15
- "no-shadow": [2, {"builtinGlobals": false, "hoist": "functions", "allow": ["err", "error", "req", "res", "request", "response", "rows", "done", "next", "callback", "props"]}],
16
- "no-unused-vars": [2, {"argsIgnorePattern": "err|rows|req|res|next"}],
17
- "no-plusplus": [2, {"allowForLoopAfterthoughts": true}],
18
- "no-lonely-if": 0,
19
- "object-curly-newline": 0,
20
- "no-return-assign": [2, "except-parens"],
21
- "prefer-destructuring": 0,
22
- "no-console": 0,
23
- "func-names": 0,
24
- "function-paren-newline": 0,
25
- "no-param-reassign": 0,
26
- "no-buffer-constructor": 0,
27
- "radix": 0,
28
- "consistent-return": 0,
29
- "arrow-body-style": 0,
30
- "arrow-parens": 0,
31
- "no-underscore-dangle": 0,
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,49 @@
1
1
  {
2
- "name": "@speechanddebate/eslint-config-nsda",
3
- "version": "1.0.26",
4
- "description": "NSDA ESLint config",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/speechanddebate/eslint-config-nsda.git"
12
- },
13
- "keywords": [
14
- "eslint",
15
- "eslintconfig"
16
- ],
17
- "author": "Aaron Hardy <aaron.hardy@speechanddebate.org> (https://speechanddebate.org)",
18
- "license": "ISC",
19
- "bugs": {
20
- "url": "https://github.com/speechanddebate/eslint-config-nsda/issues"
21
- },
22
- "homepage": "https://github.com/speechanddebate/eslint-config-nsda#readme",
23
- "peerDependencies": {
24
- "eslint": "^8.15.0",
25
- "eslint-plugin-import": "^2.25.2",
26
- "eslint-plugin-jsx-a11y": "^6.5.1",
27
- "eslint-plugin-react": "^7.30.0",
28
- "eslint-plugin-svelte": "^2.35.0"
29
- },
30
- "dependencies": {
31
- "eslint-config-airbnb": "^19.0.4",
32
- "eslint-config-airbnb-base": "^15.0.0",
33
- "eslint-plugin-jest": "26.5.3",
34
- "eslint-plugin-react": "^7.30.0",
35
- "eslint-plugin-svelte": "^2.35.0",
36
- "eslint-plugin-testing-library": "^6.0.1"
37
- }
2
+ "name": "@speechanddebate/eslint-config-nsda",
3
+ "version": "2.0.1",
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
+ "svelte": "^4.2.18",
44
+ "typescript-eslint": "^7.13.1"
45
+ },
46
+ "devDependencies": {
47
+ "prettier": "^3.2.5"
48
+ }
38
49
  }
@@ -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
+ };
@@ -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,7 @@
1
+ export default {
2
+ files: ['**/*.test.js', '**/*.test.ts', '**/*.test.jsx', '**/*.test.tsx'],
3
+ rules: {
4
+ 'jest/expect-expect': 0,
5
+ 'jest/prefer-expect-assertions': 0,
6
+ },
7
+ };
@@ -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
+ };
@@ -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
+ };
@@ -0,0 +1,7 @@
1
+ export default {
2
+ files: ['**/*.test.js', '**/*.test.ts', '**/*.test.jsx', '**/*.test.tsx'],
3
+ rules: {
4
+ 'vitest/expect-expect': 0,
5
+ 'vitest/prefer-expect-assertions': 0,
6
+ },
7
+ };
package/jest.js DELETED
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- "plugins": [
3
- "jest",
4
- ],
5
- "extends": ["airbnb", "plugin:jest/recommended", "./index.js", "./react.js"],
6
- "rules": {
7
- "jest/prefer-expect-assertions": "off",
8
- "jest/expect-expect": "off"
9
- }
10
- };
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
@@ -1,17 +0,0 @@
1
- module.exports = {
2
- "extends": [
3
- 'plugin:svelte/base',
4
- ],
5
- "plugins": [
6
- "import",
7
- "svelte"
8
- ],
9
- "env": {
10
- "browser": true,
11
- "node": true,
12
- "jest": true
13
- },
14
- "parserOptions": {
15
- "ecmaVersion": 2022,
16
- },
17
- };
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
- };