@tata-v/eslint-config-nextjs 1.0.5 → 2.0.4
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/README.md +31 -0
- package/index.js +119 -103
- package/package.json +12 -6
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Install
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
pnpm add -D @tata-v/eslint-config-nextjs
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
eslint.config.mjs
|
|
8
|
+
|
|
9
|
+
```mjs
|
|
10
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
11
|
+
import tataNextConfig from '@tata-v/eslint-config-nextjs';
|
|
12
|
+
|
|
13
|
+
export default defineConfig([
|
|
14
|
+
...tataNextConfig(),
|
|
15
|
+
|
|
16
|
+
globalIgnores([
|
|
17
|
+
'.next/**',
|
|
18
|
+
'out/**',
|
|
19
|
+
'build/**',
|
|
20
|
+
'next-env.d.ts',
|
|
21
|
+
]),
|
|
22
|
+
|
|
23
|
+
// Project-specific overrides
|
|
24
|
+
{
|
|
25
|
+
rules: {
|
|
26
|
+
'@next/next/no-img-element': 'off',
|
|
27
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
]);
|
|
31
|
+
```
|
package/index.js
CHANGED
|
@@ -1,104 +1,120 @@
|
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
1
|
+
import nextVitals from 'eslint-config-next/core-web-vitals';
|
|
2
|
+
import nextTs from 'eslint-config-next/typescript';
|
|
3
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
4
|
+
|
|
5
|
+
export default function tataNextConfig(options = {}) {
|
|
6
|
+
const {
|
|
7
|
+
files = ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
|
|
8
|
+
} = options;
|
|
9
|
+
|
|
10
|
+
return [
|
|
11
|
+
...nextVitals,
|
|
12
|
+
...nextTs,
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
files,
|
|
16
|
+
plugins: {
|
|
17
|
+
'@stylistic': stylistic,
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
rules: {
|
|
21
|
+
// Stylistic
|
|
22
|
+
'@stylistic/indent': ['error', 2, { SwitchCase: 1, ignoredNodes: ['TSTypeAliasDeclaration *', 'TSUnionType', 'TSIntersectionType'] }],
|
|
23
|
+
|
|
24
|
+
// ESLint core
|
|
25
|
+
eqeqeq: 'warn',
|
|
26
|
+
'no-var': 'warn',
|
|
27
|
+
'no-extra-semi': 'error',
|
|
28
|
+
'no-debugger': 'off',
|
|
29
|
+
'no-nested-ternary': 'off',
|
|
30
|
+
'no-alert': 'off',
|
|
31
|
+
'max-len': 'off',
|
|
32
|
+
'no-use-before-define': 'off',
|
|
33
|
+
'no-shadow': 'off',
|
|
34
|
+
'no-param-reassign': 'off',
|
|
35
|
+
'no-undef': 'off',
|
|
36
|
+
'object-curly-newline': 'off',
|
|
37
|
+
'consistent-return': 'off',
|
|
38
|
+
'no-tabs': 'off',
|
|
39
|
+
camelcase: 'off',
|
|
40
|
+
'dot-notation': 'off',
|
|
41
|
+
'no-redeclare': 'off',
|
|
42
|
+
'prefer-destructuring': 'off',
|
|
43
|
+
'no-unsafe-optional-chaining': 'off',
|
|
44
|
+
'func-names': 'off',
|
|
45
|
+
'no-multi-assign': 'off',
|
|
46
|
+
'no-plusplus': 'off',
|
|
47
|
+
'no-return-assign': 'off',
|
|
48
|
+
|
|
49
|
+
// formatting
|
|
50
|
+
quotes: ['error', 'single'],
|
|
51
|
+
'arrow-parens': ['error', 'always'],
|
|
52
|
+
semi: ['error', 'always'],
|
|
53
|
+
'comma-spacing': ['error', { before: false, after: true }],
|
|
54
|
+
|
|
55
|
+
// React
|
|
56
|
+
'react/prop-types': 'off',
|
|
57
|
+
'react/jsx-filename-extension': [
|
|
58
|
+
'error',
|
|
59
|
+
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
|
|
60
|
+
],
|
|
61
|
+
'react/jsx-pascal-case': 'warn',
|
|
62
|
+
'react/jsx-key': 'warn',
|
|
63
|
+
'react/function-component-definition': [
|
|
64
|
+
'error',
|
|
65
|
+
{
|
|
66
|
+
namedComponents: [
|
|
67
|
+
'arrow-function',
|
|
68
|
+
'function-declaration',
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
'react/react-in-jsx-scope': 'off',
|
|
73
|
+
'react/prefer-stateless-function': 'off',
|
|
74
|
+
'react/jsx-one-expression-per-line': 'off',
|
|
75
|
+
'react/jsx-props-no-spreading': 'off',
|
|
76
|
+
'react/button-has-type': 'off',
|
|
77
|
+
'react/destructuring-assignment': 'off',
|
|
78
|
+
'react/no-array-index-key': 'off',
|
|
79
|
+
'react/jsx-no-useless-fragment': 'off',
|
|
80
|
+
'react/no-unused-prop-types': 'warn',
|
|
81
|
+
'react/require-default-props': 'off',
|
|
82
|
+
'react/no-unknown-property': 'off',
|
|
83
|
+
|
|
84
|
+
// Hooks
|
|
85
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
86
|
+
'react-hooks/rules-of-hooks': 'off',
|
|
87
|
+
|
|
88
|
+
// Import
|
|
89
|
+
'import/prefer-default-export': 'off',
|
|
90
|
+
'import/no-unresolved': 'off',
|
|
91
|
+
'import/extensions': 'off',
|
|
92
|
+
'import/no-extraneous-dependencies': 'off',
|
|
93
|
+
'import/order': 'off',
|
|
94
|
+
'import/no-absolute-path': 'error',
|
|
95
|
+
|
|
96
|
+
// A11y
|
|
97
|
+
'jsx-a11y/no-noninteractive-element-interactions': 'off',
|
|
98
|
+
'jsx-a11y/click-events-have-key-events': 'off',
|
|
99
|
+
'jsx-a11y/no-static-element-interactions': 'off',
|
|
100
|
+
'jsx-a11y/control-has-associated-label': 'off',
|
|
101
|
+
'jsx-a11y/label-has-associated-control': 'off',
|
|
102
|
+
|
|
103
|
+
// TypeScript
|
|
104
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
105
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
106
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
107
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
settings: {
|
|
111
|
+
'import/resolver': {
|
|
112
|
+
node: {
|
|
113
|
+
paths: ['src'],
|
|
114
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
];
|
|
104
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tata-v/eslint-config-nextjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": {
|
|
@@ -12,11 +12,17 @@
|
|
|
12
12
|
"access": "public",
|
|
13
13
|
"registry": "https://registry.npmjs.org/"
|
|
14
14
|
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"eslint": "^9.7.0",
|
|
17
|
+
"next": ">=15.0.0",
|
|
18
|
+
"typescript": ">=5.0.0"
|
|
19
|
+
},
|
|
15
20
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"eslint-config-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
+
"@stylistic/eslint-plugin": "^5.0.0",
|
|
22
|
+
"eslint-config-next": "^16.0.0"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/TATA-V/tata-eslint-config"
|
|
21
27
|
}
|
|
22
28
|
}
|