@jabworks/eslint-plugin 1.1.0 → 1.1.2
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/LICENSE +21 -0
- package/README.md +5 -7
- package/package.json +28 -17
- package/CHANGELOG.md +0 -50
- package/src/configs/base.js +0 -62
- package/src/configs/comments.js +0 -13
- package/src/configs/next.js +0 -88
- package/src/configs/react.js +0 -52
- package/src/configs/typescript.js +0 -30
- package/src/configs/vitest.js +0 -28
- package/src/lib/constants.js +0 -3
- package/src/rules/best-practice.js +0 -228
- package/src/rules/comments.js +0 -12
- package/src/rules/es6.js +0 -66
- package/src/rules/import.js +0 -116
- package/src/rules/jsx-a11y.js +0 -6
- package/src/rules/possible-errors.js +0 -35
- package/src/rules/react.js +0 -122
- package/src/rules/stylistic.js +0 -120
- package/src/rules/typescript.extension.js +0 -39
- package/src/rules/typescript.import.js +0 -19
- package/src/rules/typescript.js +0 -137
- package/src/rules/unicorn.js +0 -16
- package/src/rules/variables.js +0 -31
- package/src/rules/vitest.js +0 -10
- package/tsconfig.json +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Vi Minh Hieu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -41,13 +41,7 @@ export default [
|
|
|
41
41
|
];
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"extends": ["plugin:@jabworks/base"]
|
|
49
|
-
}
|
|
50
|
-
```
|
|
44
|
+
Legacy `.eslintrc` configs are not provided. Use flat config with ESLint v9+.
|
|
51
45
|
|
|
52
46
|
## Available Configs
|
|
53
47
|
|
|
@@ -71,6 +65,10 @@ import helper from './helper';
|
|
|
71
65
|
import styles from './styles.css';
|
|
72
66
|
```
|
|
73
67
|
|
|
68
|
+
## Compatibility
|
|
69
|
+
|
|
70
|
+
- **ESLint**: >=9.39.2
|
|
71
|
+
|
|
74
72
|
## License
|
|
75
73
|
|
|
76
74
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jabworks/eslint-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Opinionated ESLint plugin and flat config for JS, TS, React, and Next.js",
|
|
6
6
|
"keywords": [
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
"typescript-eslint"
|
|
13
13
|
],
|
|
14
14
|
"homepage": "https://github.com/jabworks/style-guide/tree/main/packages/eslint-plugin#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/jabworks/style-guide/issues"
|
|
17
|
+
},
|
|
15
18
|
"repository": {
|
|
16
19
|
"type": "git",
|
|
17
20
|
"url": "git+https://github.com/jabworks/style-guide.git",
|
|
@@ -28,6 +31,10 @@
|
|
|
28
31
|
},
|
|
29
32
|
"main": "./src/index.js",
|
|
30
33
|
"types": "./src/types/index.d.ts",
|
|
34
|
+
"files": [
|
|
35
|
+
"src/index.js",
|
|
36
|
+
"src/types/index.d.ts"
|
|
37
|
+
],
|
|
31
38
|
"dependencies": {
|
|
32
39
|
"globals": "^17.2.0"
|
|
33
40
|
},
|
|
@@ -58,21 +65,25 @@
|
|
|
58
65
|
"@jabworks/typescript-config": "0.0.0"
|
|
59
66
|
},
|
|
60
67
|
"peerDependencies": {
|
|
61
|
-
"@eslint-community/eslint-plugin-eslint-comments": "
|
|
62
|
-
"@next/eslint-plugin-next": "
|
|
63
|
-
"@
|
|
64
|
-
"eslint": "
|
|
65
|
-
"eslint
|
|
66
|
-
"eslint-plugin-
|
|
67
|
-
"eslint-plugin-
|
|
68
|
-
"eslint-plugin-
|
|
69
|
-
"eslint-plugin-
|
|
70
|
-
"eslint-plugin-react
|
|
71
|
-
"eslint-plugin-
|
|
72
|
-
"eslint-plugin-
|
|
73
|
-
"eslint-plugin-
|
|
74
|
-
"eslint-plugin-
|
|
75
|
-
"
|
|
76
|
-
"typescript
|
|
68
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
|
|
69
|
+
"@next/eslint-plugin-next": "^16.1.6",
|
|
70
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
71
|
+
"@vitest/eslint-plugin": "^1.6.6",
|
|
72
|
+
"eslint": "^9.39.2",
|
|
73
|
+
"eslint-plugin-import": "^2.32.0",
|
|
74
|
+
"eslint-plugin-jest": "^29.12.1",
|
|
75
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
76
|
+
"eslint-plugin-playwright": "^2.5.1",
|
|
77
|
+
"eslint-plugin-react": "^7.37.5",
|
|
78
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
79
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
80
|
+
"eslint-plugin-testing-library": "^7.13.5",
|
|
81
|
+
"eslint-plugin-turbo": "^2.8.0",
|
|
82
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
83
|
+
"typescript": "^5.9.3",
|
|
84
|
+
"typescript-eslint": "^8.54.0"
|
|
85
|
+
},
|
|
86
|
+
"publishConfig": {
|
|
87
|
+
"access": "public"
|
|
77
88
|
}
|
|
78
89
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# @jabworks/eslint-plugin
|
|
2
|
-
|
|
3
|
-
## 1.1.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- Bump deps version
|
|
8
|
-
- Update react rules in next config
|
|
9
|
-
|
|
10
|
-
## 1.0.6
|
|
11
|
-
|
|
12
|
-
### Patch Changes
|
|
13
|
-
|
|
14
|
-
- Update dependencies to latest
|
|
15
|
-
|
|
16
|
-
## 1.0.5
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- Update README.md
|
|
21
|
-
|
|
22
|
-
## 1.0.4
|
|
23
|
-
|
|
24
|
-
### Patch Changes
|
|
25
|
-
|
|
26
|
-
- Fix stylistic rule typo
|
|
27
|
-
|
|
28
|
-
## 1.0.3
|
|
29
|
-
|
|
30
|
-
### Patch Changes
|
|
31
|
-
|
|
32
|
-
- Tweak stylistic rules
|
|
33
|
-
|
|
34
|
-
## 1.0.2
|
|
35
|
-
|
|
36
|
-
### Patch Changes
|
|
37
|
-
|
|
38
|
-
- Move workspace dep to dev dep
|
|
39
|
-
|
|
40
|
-
## 1.0.1
|
|
41
|
-
|
|
42
|
-
### Patch Changes
|
|
43
|
-
|
|
44
|
-
- Change dev deps to regular deps
|
|
45
|
-
|
|
46
|
-
## 1.0.0
|
|
47
|
-
|
|
48
|
-
### Major Changes
|
|
49
|
-
|
|
50
|
-
- Initial release
|
package/src/configs/base.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import eslintjs from '@eslint/js';
|
|
2
|
-
import stylisticPlugin from '@stylistic/eslint-plugin';
|
|
3
|
-
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
4
|
-
import importPlugin from 'eslint-plugin-import';
|
|
5
|
-
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
6
|
-
import unicorn from 'eslint-plugin-unicorn';
|
|
7
|
-
import tseslint from 'typescript-eslint';
|
|
8
|
-
import bestPractice from '../rules/best-practice.js';
|
|
9
|
-
import es6 from '../rules/es6.js';
|
|
10
|
-
import importConfig from '../rules/import.js';
|
|
11
|
-
import possibleErrors from '../rules/possible-errors.js';
|
|
12
|
-
import stylistic from '../rules/stylistic.js';
|
|
13
|
-
import variables from '../rules/variables.js';
|
|
14
|
-
import comments from './comments.js';
|
|
15
|
-
|
|
16
|
-
/** @type {import('eslint').Linter.Config} */
|
|
17
|
-
export const baseConfig = {
|
|
18
|
-
name: '@jabworks/eslint-config-base',
|
|
19
|
-
plugins: {
|
|
20
|
-
unicorn,
|
|
21
|
-
'simple-import-sort': simpleImportSort,
|
|
22
|
-
},
|
|
23
|
-
rules: {
|
|
24
|
-
...bestPractice,
|
|
25
|
-
...es6,
|
|
26
|
-
...importConfig,
|
|
27
|
-
...possibleErrors,
|
|
28
|
-
...stylistic,
|
|
29
|
-
...variables,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
34
|
-
const configs = [
|
|
35
|
-
eslintjs.configs.recommended,
|
|
36
|
-
eslintConfigPrettier,
|
|
37
|
-
...tseslint.configs.recommended,
|
|
38
|
-
importPlugin.flatConfigs.recommended,
|
|
39
|
-
...comments,
|
|
40
|
-
stylisticPlugin.configs.customize({
|
|
41
|
-
semi: true,
|
|
42
|
-
arrowParens: 'as-needed',
|
|
43
|
-
}),
|
|
44
|
-
baseConfig,
|
|
45
|
-
{
|
|
46
|
-
ignores: [
|
|
47
|
-
'dist/**',
|
|
48
|
-
'build/**',
|
|
49
|
-
'out/**',
|
|
50
|
-
'coverage/**',
|
|
51
|
-
'node_modules/**',
|
|
52
|
-
'eslint.config.js',
|
|
53
|
-
'eslint.config.mjs',
|
|
54
|
-
'eslint.config.cjs',
|
|
55
|
-
'*.config.js',
|
|
56
|
-
'*.config.mjs',
|
|
57
|
-
'*.config.cjs',
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
export default configs;
|
package/src/configs/comments.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs';
|
|
2
|
-
import commentsRules from '../rules/comments.js';
|
|
3
|
-
|
|
4
|
-
/** @type {import('eslint').Linter.Config} */
|
|
5
|
-
export const commentsConfig = {
|
|
6
|
-
name: '@jabworks/eslint-config-comments',
|
|
7
|
-
rules: commentsRules,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
11
|
-
const configs = [comments.recommended, commentsConfig];
|
|
12
|
-
|
|
13
|
-
export default configs;
|
package/src/configs/next.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import pluginNext from '@next/eslint-plugin-next';
|
|
3
|
-
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
4
|
-
import importPlugin from 'eslint-plugin-import';
|
|
5
|
-
import pluginReact from 'eslint-plugin-react';
|
|
6
|
-
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
7
|
-
import globals from 'globals';
|
|
8
|
-
|
|
9
|
-
import reactRules from '../rules/react.js';
|
|
10
|
-
import baseConfig from './base.js';
|
|
11
|
-
import tseslintConfigs, { tseslintConfig } from './typescript.js';
|
|
12
|
-
|
|
13
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
14
|
-
const configs = [
|
|
15
|
-
...baseConfig,
|
|
16
|
-
js.configs.recommended,
|
|
17
|
-
eslintConfigPrettier,
|
|
18
|
-
importPlugin.flatConfigs.recommended,
|
|
19
|
-
pluginReact.configs.flat.recommended,
|
|
20
|
-
pluginReact.configs.flat['jsx-runtime'],
|
|
21
|
-
...tseslintConfigs,
|
|
22
|
-
{
|
|
23
|
-
name: '@jabworks/eslint-config-nextjs',
|
|
24
|
-
plugins: {
|
|
25
|
-
'@next/next': pluginNext,
|
|
26
|
-
'react-hooks': pluginReactHooks,
|
|
27
|
-
},
|
|
28
|
-
languageOptions: {
|
|
29
|
-
...pluginReact.configs.flat.recommended?.languageOptions,
|
|
30
|
-
globals: {
|
|
31
|
-
...globals.serviceworker,
|
|
32
|
-
...globals.browser,
|
|
33
|
-
},
|
|
34
|
-
parserOptions: {
|
|
35
|
-
projectService: true,
|
|
36
|
-
tsconfigRootDir: import.meta.dirname,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
settings: {
|
|
40
|
-
'import/resolver': { node: {} },
|
|
41
|
-
react: { version: 'detect' },
|
|
42
|
-
},
|
|
43
|
-
linterOptions: {
|
|
44
|
-
reportUnusedDisableDirectives: true,
|
|
45
|
-
},
|
|
46
|
-
rules: {
|
|
47
|
-
...pluginReactHooks.configs['recommended-latest'].rules,
|
|
48
|
-
...reactRules,
|
|
49
|
-
...pluginNext.configs.recommended.rules,
|
|
50
|
-
...pluginNext.configs['core-web-vitals'].rules,
|
|
51
|
-
...tseslintConfig.rules,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
files: [
|
|
56
|
-
'*.config.ts',
|
|
57
|
-
'**/*.d.ts',
|
|
58
|
-
'**/*.stories.ts',
|
|
59
|
-
'**/*.stories.tsx',
|
|
60
|
-
'app/**/*error.tsx',
|
|
61
|
-
'app/**/layout.tsx',
|
|
62
|
-
'app/**/not-found.tsx',
|
|
63
|
-
'app/**/opengraph-image.tsx',
|
|
64
|
-
'app/**/page.tsx',
|
|
65
|
-
'app/apple-icon.tsx',
|
|
66
|
-
'app/robots.ts',
|
|
67
|
-
'app/sitemap.ts',
|
|
68
|
-
'next.config.mjs',
|
|
69
|
-
'src/app/**/*error.tsx',
|
|
70
|
-
'src/app/**/layout.tsx',
|
|
71
|
-
'src/app/**/not-found.tsx',
|
|
72
|
-
'src/app/**/opengraph-image.tsx',
|
|
73
|
-
'src/app/**/page.tsx',
|
|
74
|
-
'src/app/apple-icon.tsx',
|
|
75
|
-
'src/app/robots.ts',
|
|
76
|
-
'src/app/sitemap.ts',
|
|
77
|
-
],
|
|
78
|
-
rules: {
|
|
79
|
-
'import/no-default-export': 'off',
|
|
80
|
-
'import/prefer-default-export': ['error', { target: 'any' }],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
ignores: ['.next/**'],
|
|
85
|
-
},
|
|
86
|
-
];
|
|
87
|
-
|
|
88
|
-
export default configs;
|
package/src/configs/react.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
3
|
-
import importPlugin from 'eslint-plugin-import';
|
|
4
|
-
import pluginReact from 'eslint-plugin-react';
|
|
5
|
-
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
6
|
-
import globals from 'globals';
|
|
7
|
-
|
|
8
|
-
import reactRules from '../rules/react.js';
|
|
9
|
-
import baseConfig from './base.js';
|
|
10
|
-
import tseslintConfig from './typescript.js';
|
|
11
|
-
|
|
12
|
-
/** @type {import("eslint").Linter.Config} */
|
|
13
|
-
export const reactConfig = {
|
|
14
|
-
name: '@jabworks/eslint-config-react',
|
|
15
|
-
languageOptions: {
|
|
16
|
-
...pluginReact.configs.flat.recommended?.languageOptions,
|
|
17
|
-
globals: {
|
|
18
|
-
...globals.serviceworker,
|
|
19
|
-
...globals.browser,
|
|
20
|
-
},
|
|
21
|
-
parserOptions: {
|
|
22
|
-
projectService: true,
|
|
23
|
-
tsconfigRootDir: import.meta.dirname,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
plugins: {
|
|
27
|
-
'react-hooks': pluginReactHooks,
|
|
28
|
-
},
|
|
29
|
-
settings: { react: { version: 'detect' } },
|
|
30
|
-
rules: {
|
|
31
|
-
...pluginReactHooks.configs['recommended-latest'].rules,
|
|
32
|
-
...reactRules,
|
|
33
|
-
'import/no-cycle': 'error',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A custom ESLint configuration for libraries that use React.
|
|
39
|
-
*
|
|
40
|
-
* @type {import("eslint").Linter.Config[]}
|
|
41
|
-
*/
|
|
42
|
-
const configs = [
|
|
43
|
-
js.configs.recommended,
|
|
44
|
-
eslintConfigPrettier,
|
|
45
|
-
importPlugin.flatConfigs.recommended,
|
|
46
|
-
...baseConfig,
|
|
47
|
-
...tseslintConfig,
|
|
48
|
-
pluginReact.configs.flat.recommended,
|
|
49
|
-
reactConfig,
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
export default configs;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
2
|
-
import importPlugin from 'eslint-plugin-import';
|
|
3
|
-
import tseslint from 'typescript-eslint';
|
|
4
|
-
|
|
5
|
-
import { TYPESCRIPT_FILES } from '../lib/constants.js';
|
|
6
|
-
import typescriptExtensionRules from '../rules/typescript.extension.js';
|
|
7
|
-
import typescriptImportRules from '../rules/typescript.import.js';
|
|
8
|
-
import typescriptRules from '../rules/typescript.js';
|
|
9
|
-
|
|
10
|
-
/** @type {import('eslint').Linter.Config} */
|
|
11
|
-
export const tseslintConfig = {
|
|
12
|
-
name: '@jabworks/eslint-config-typescript',
|
|
13
|
-
files: TYPESCRIPT_FILES,
|
|
14
|
-
rules: {
|
|
15
|
-
...typescriptRules,
|
|
16
|
-
...typescriptExtensionRules,
|
|
17
|
-
...typescriptImportRules,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
22
|
-
const configs = [
|
|
23
|
-
...tseslint.configs.strictTypeChecked,
|
|
24
|
-
...tseslint.configs.stylisticTypeChecked,
|
|
25
|
-
importPlugin.flatConfigs.typescript,
|
|
26
|
-
eslintConfigPrettier,
|
|
27
|
-
tseslintConfig,
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
export default configs;
|
package/src/configs/vitest.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import vitest from '@vitest/eslint-plugin';
|
|
2
|
-
import globals from 'globals';
|
|
3
|
-
|
|
4
|
-
import vitestRules from '../rules/vitest.js';
|
|
5
|
-
|
|
6
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
7
|
-
const configs = [
|
|
8
|
-
{
|
|
9
|
-
name: '@jabworks/eslint-config-vitest',
|
|
10
|
-
files: ['**/*.test.{js,ts,mjs,cjs,jsx,tsx}', '**/__tests__/**', '**/tests/**'],
|
|
11
|
-
plugins: {
|
|
12
|
-
vitest,
|
|
13
|
-
},
|
|
14
|
-
languageOptions: {
|
|
15
|
-
globals: {
|
|
16
|
-
...globals.node,
|
|
17
|
-
...globals.vitest,
|
|
18
|
-
vi: 'readonly',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
...vitest.configs.recommended.rules,
|
|
23
|
-
...vitestRules,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
export default configs;
|
package/src/lib/constants.js
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/** @type {import('eslint').Linter.RulesRecord} */
|
|
2
|
-
const rules = {
|
|
3
|
-
/**
|
|
4
|
-
* Require return statements in array methods callbacks.
|
|
5
|
-
*
|
|
6
|
-
* 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return
|
|
7
|
-
*/
|
|
8
|
-
'array-callback-return': ['error', { allowImplicit: true }],
|
|
9
|
-
/**
|
|
10
|
-
* Treat `var` statements as if they were block scoped.
|
|
11
|
-
*
|
|
12
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var
|
|
13
|
-
*/
|
|
14
|
-
'block-scoped-var': 'error',
|
|
15
|
-
/**
|
|
16
|
-
* Require curly braces for multiline blocks.
|
|
17
|
-
*
|
|
18
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/curly
|
|
19
|
-
*/
|
|
20
|
-
curly: ['warn', 'multi-line'],
|
|
21
|
-
/**
|
|
22
|
-
* Require default clauses in switch statements to be last (if used).
|
|
23
|
-
*
|
|
24
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last
|
|
25
|
-
*/
|
|
26
|
-
'default-case-last': 'error',
|
|
27
|
-
/**
|
|
28
|
-
* Require triple equals (`===` and `!==`).
|
|
29
|
-
*
|
|
30
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq
|
|
31
|
-
*/
|
|
32
|
-
eqeqeq: 'error',
|
|
33
|
-
/**
|
|
34
|
-
* Require grouped accessor pairs in object literals and classes.
|
|
35
|
-
*
|
|
36
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs
|
|
37
|
-
*/
|
|
38
|
-
'grouped-accessor-pairs': 'error',
|
|
39
|
-
/**
|
|
40
|
-
* Disallow use of `alert()`.
|
|
41
|
-
*
|
|
42
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-alert
|
|
43
|
-
*/
|
|
44
|
-
'no-alert': 'error',
|
|
45
|
-
/**
|
|
46
|
-
* Disallow use of `caller`/`callee`.
|
|
47
|
-
*
|
|
48
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-caller
|
|
49
|
-
*/
|
|
50
|
-
'no-caller': 'error',
|
|
51
|
-
/**
|
|
52
|
-
* Disallow returning value in constructor.
|
|
53
|
-
*
|
|
54
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return
|
|
55
|
-
*/
|
|
56
|
-
'no-constructor-return': 'error',
|
|
57
|
-
/**
|
|
58
|
-
* Disallow using an `else` if the `if` block contains a return.
|
|
59
|
-
*
|
|
60
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/no-else-return
|
|
61
|
-
*/
|
|
62
|
-
'no-else-return': 'warn',
|
|
63
|
-
/**
|
|
64
|
-
* Disallow `eval()`.
|
|
65
|
-
*
|
|
66
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-eval
|
|
67
|
-
*/
|
|
68
|
-
'no-eval': 'error',
|
|
69
|
-
/**
|
|
70
|
-
* Disallow extending native objects.
|
|
71
|
-
*
|
|
72
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native
|
|
73
|
-
*/
|
|
74
|
-
'no-extend-native': 'error',
|
|
75
|
-
/**
|
|
76
|
-
* Disallow unnecessary function binding.
|
|
77
|
-
*
|
|
78
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind
|
|
79
|
-
*/
|
|
80
|
-
'no-extra-bind': 'error',
|
|
81
|
-
/**
|
|
82
|
-
* Disallow unnecessary labels.
|
|
83
|
-
*
|
|
84
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label
|
|
85
|
-
*/
|
|
86
|
-
'no-extra-label': 'error',
|
|
87
|
-
/**
|
|
88
|
-
* Disallow floating decimals.
|
|
89
|
-
*
|
|
90
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/no-floating-decimal
|
|
91
|
-
*/
|
|
92
|
-
'no-floating-decimal': 'error',
|
|
93
|
-
/**
|
|
94
|
-
* Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.
|
|
95
|
-
*
|
|
96
|
-
* 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion
|
|
97
|
-
*/
|
|
98
|
-
'no-implicit-coercion': 'error',
|
|
99
|
-
/**
|
|
100
|
-
* Disallow use of `eval()`-like methods.
|
|
101
|
-
*
|
|
102
|
-
* https://eslint.org/docs/rules/no-implied-eval
|
|
103
|
-
*/
|
|
104
|
-
'no-implied-eval': 'error',
|
|
105
|
-
/**
|
|
106
|
-
* Disallow usage of `__iterator__` property.
|
|
107
|
-
*
|
|
108
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator
|
|
109
|
-
*/
|
|
110
|
-
'no-iterator': 'error',
|
|
111
|
-
/**
|
|
112
|
-
* Disallow use of labels for anything other than loops and switches.
|
|
113
|
-
*
|
|
114
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-labels
|
|
115
|
-
*/
|
|
116
|
-
'no-labels': ['error'],
|
|
117
|
-
/**
|
|
118
|
-
* Disallow unnecessary nested blocks.
|
|
119
|
-
*
|
|
120
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks
|
|
121
|
-
*/
|
|
122
|
-
'no-lone-blocks': 'error',
|
|
123
|
-
/**
|
|
124
|
-
* Disallow `new` for side effects.
|
|
125
|
-
*
|
|
126
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new
|
|
127
|
-
*/
|
|
128
|
-
'no-new': 'error',
|
|
129
|
-
/**
|
|
130
|
-
* Disallow function constructors.
|
|
131
|
-
*
|
|
132
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func
|
|
133
|
-
*/
|
|
134
|
-
'no-new-func': 'error',
|
|
135
|
-
/**
|
|
136
|
-
* Disallow primitive wrapper instances, such as `new String('foo')`.
|
|
137
|
-
*
|
|
138
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers
|
|
139
|
-
*/
|
|
140
|
-
'no-new-wrappers': 'error',
|
|
141
|
-
/**
|
|
142
|
-
* Disallow use of octal escape sequences in string literals.
|
|
143
|
-
*
|
|
144
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape
|
|
145
|
-
*/
|
|
146
|
-
'no-octal-escape': 'error',
|
|
147
|
-
/**
|
|
148
|
-
* Disallow reassignment of function parameters.
|
|
149
|
-
*
|
|
150
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign
|
|
151
|
-
*/
|
|
152
|
-
'no-param-reassign': 'error',
|
|
153
|
-
/**
|
|
154
|
-
* Disallow usage of the deprecated `__proto__` property.
|
|
155
|
-
*
|
|
156
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-proto
|
|
157
|
-
*/
|
|
158
|
-
'no-proto': 'error',
|
|
159
|
-
/**
|
|
160
|
-
* Disallow assignment in `return` statement.
|
|
161
|
-
*
|
|
162
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign
|
|
163
|
-
*/
|
|
164
|
-
'no-return-assign': 'error',
|
|
165
|
-
/**
|
|
166
|
-
* Disallow use of `javascript:` urls.
|
|
167
|
-
*
|
|
168
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url
|
|
169
|
-
*/
|
|
170
|
-
'no-script-url': 'error',
|
|
171
|
-
/**
|
|
172
|
-
* Disallow comparisons where both sides are exactly the same.
|
|
173
|
-
*
|
|
174
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare
|
|
175
|
-
*/
|
|
176
|
-
'no-self-compare': 'error',
|
|
177
|
-
/**
|
|
178
|
-
* Disallow use of comma operator.
|
|
179
|
-
*
|
|
180
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences
|
|
181
|
-
*/
|
|
182
|
-
'no-sequences': 'error',
|
|
183
|
-
/**
|
|
184
|
-
* Disallow unnecessary `.call()` and `.apply()`.
|
|
185
|
-
*
|
|
186
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call
|
|
187
|
-
*/
|
|
188
|
-
'no-useless-call': 'error',
|
|
189
|
-
/**
|
|
190
|
-
* Disallow unnecessary concatenation of strings.
|
|
191
|
-
*
|
|
192
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-concat
|
|
193
|
-
*/
|
|
194
|
-
'no-useless-concat': 'error',
|
|
195
|
-
/**
|
|
196
|
-
* Disallow redundant return statements.
|
|
197
|
-
*
|
|
198
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/no-useless-return
|
|
199
|
-
*/
|
|
200
|
-
'no-useless-return': 'warn',
|
|
201
|
-
/**
|
|
202
|
-
* Require using named capture groups in regular expressions.
|
|
203
|
-
*
|
|
204
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group
|
|
205
|
-
*/
|
|
206
|
-
// 'prefer-named-capture-group': 'error',
|
|
207
|
-
/**
|
|
208
|
-
* Require using Error objects as Promise rejection reasons.
|
|
209
|
-
*
|
|
210
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-promise-reject-errors
|
|
211
|
-
*/
|
|
212
|
-
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
|
|
213
|
-
/**
|
|
214
|
-
* Disallow use of the RegExp constructor in favor of regular expression
|
|
215
|
-
* literals.
|
|
216
|
-
*
|
|
217
|
-
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-regex-literals
|
|
218
|
-
*/
|
|
219
|
-
'prefer-regex-literals': 'error',
|
|
220
|
-
/**
|
|
221
|
-
* Disallow "Yoda conditions", ensuring the comparison.
|
|
222
|
-
*
|
|
223
|
-
* 🔧 Fixable - https://eslint.org/docs/rules/yoda
|
|
224
|
-
*/
|
|
225
|
-
yoda: 'warn',
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
export default rules;
|