@paratco/eslint-config 0.7.0 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paratco/eslint-config",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "author": "Paratco",
@@ -1,25 +1,25 @@
1
- import eslintPluginImport from "eslint-plugin-import";
2
-
3
- // Custom Rules
4
- import importRules from "../lints/import/index.js";
5
-
6
- export default [
7
- // ESLint Plugin Import
8
- {
9
- files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
10
- plugins: {
11
- import: eslintPluginImport
12
- },
13
- settings: {
14
- "import/resolver": {
15
- typescript: {
16
- alwaysTryTypes: true
17
- }
18
- }
19
- },
20
- rules: {
21
- ...eslintPluginImport.configs.recommended.rules,
22
- ...importRules
23
- }
24
- }
25
- ];
1
+ import eslintPluginImport from "eslint-plugin-import";
2
+
3
+ // Custom Rules
4
+ import importRules from "../lints/import/index.js";
5
+
6
+ export default [
7
+ // ESLint Plugin Import
8
+ {
9
+ files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
10
+ plugins: {
11
+ import: eslintPluginImport
12
+ },
13
+ settings: {
14
+ "import/resolver": {
15
+ typescript: {
16
+ alwaysTryTypes: true
17
+ }
18
+ }
19
+ },
20
+ rules: {
21
+ ...eslintPluginImport.configs.recommended.rules,
22
+ ...importRules
23
+ }
24
+ }
25
+ ];
@@ -1,11 +1,11 @@
1
- import globals from "globals";
2
- import baseConfig from "./base.js";
3
- import importConfig from "./import.js";
4
-
5
- export default [
6
- ...baseConfig,
7
- ...importConfig,
8
-
9
- // Node Only
10
- { languageOptions: { globals: globals.node } }
11
- ];
1
+ import globals from "globals";
2
+ import baseConfig from "./base.js";
3
+ import importConfig from "./import.js";
4
+
5
+ export default [
6
+ ...baseConfig,
7
+ ...importConfig,
8
+
9
+ // Node Only
10
+ { languageOptions: { globals: globals.node } }
11
+ ];
@@ -1,60 +1,60 @@
1
- import globals from "globals";
2
- import baseConfig from "./base.js";
3
- import importConfig from "./import.js";
4
-
5
- // Plugins
6
- import react from "eslint-plugin-react";
7
- import reactHooks from "eslint-plugin-react-hooks";
8
- import reactRefresh from "eslint-plugin-react-refresh";
9
-
10
- // Custom Rules
11
- import reactRules from "../lints/react/index.js";
12
-
13
- export default [
14
- ...baseConfig,
15
- ...importConfig,
16
-
17
- // Browser Only
18
- { languageOptions: { globals: globals.browser } },
19
-
20
- // Enable JSX
21
- { files: ["**/*.tsx"], languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
22
-
23
- // React Plugin
24
- {
25
- files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
26
- plugins: {
27
- react: react,
28
- "react-hooks": reactHooks,
29
- "react-refresh": reactRefresh
30
- },
31
- settings: {
32
- react: {
33
- version: "detect"
34
- }
35
- },
36
- languageOptions: {
37
- parserOptions: {
38
- ecmaFeatures: {
39
- jsx: true
40
- }
41
- },
42
- globals: {
43
- ...globals.browser
44
- }
45
- },
46
- rules: {
47
- ...reactRules,
48
- // ...react.configs.recommended.rules,
49
- ...reactHooks.configs.recommended.rules,
50
-
51
- // Enforce Rules of Hooks
52
- "react-hooks/rules-of-hooks": ["error"],
53
- // Verify the list of the dependencies for Hooks like useEffect and similar
54
- "react-hooks/exhaustive-deps": ["error"],
55
-
56
- // React Refresh
57
- "react-refresh/only-export-components": ["warn", { allowConstantExport: true }]
58
- }
59
- }
60
- ];
1
+ import globals from "globals";
2
+ import baseConfig from "./base.js";
3
+ import importConfig from "./import.js";
4
+
5
+ // Plugins
6
+ import react from "eslint-plugin-react";
7
+ import reactHooks from "eslint-plugin-react-hooks";
8
+ import reactRefresh from "eslint-plugin-react-refresh";
9
+
10
+ // Custom Rules
11
+ import reactRules from "../lints/react/index.js";
12
+
13
+ export default [
14
+ ...baseConfig,
15
+ ...importConfig,
16
+
17
+ // Browser Only
18
+ { languageOptions: { globals: globals.browser } },
19
+
20
+ // Enable JSX
21
+ { files: ["**/*.tsx"], languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
22
+
23
+ // React Plugin
24
+ {
25
+ files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
26
+ plugins: {
27
+ react: react,
28
+ "react-hooks": reactHooks,
29
+ "react-refresh": reactRefresh
30
+ },
31
+ settings: {
32
+ react: {
33
+ version: "detect"
34
+ }
35
+ },
36
+ languageOptions: {
37
+ parserOptions: {
38
+ ecmaFeatures: {
39
+ jsx: true
40
+ }
41
+ },
42
+ globals: {
43
+ ...globals.browser
44
+ }
45
+ },
46
+ rules: {
47
+ ...reactRules,
48
+ // ...react.configs.recommended.rules,
49
+ ...reactHooks.configs.recommended.rules,
50
+
51
+ // Enforce Rules of Hooks
52
+ "react-hooks/rules-of-hooks": ["error"],
53
+ // Verify the list of the dependencies for Hooks like useEffect and similar
54
+ "react-hooks/exhaustive-deps": ["error"],
55
+
56
+ // React Refresh
57
+ "react-refresh/only-export-components": ["warn", { allowConstantExport: true }]
58
+ }
59
+ }
60
+ ];
@@ -1,159 +1,159 @@
1
- export default {
2
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md
3
- // Forbid imported names marked with @deprecated documentation tag.
4
- "import/no-deprecated": ["error"],
5
-
6
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-empty-named-blocks.md
7
- // Forbid empty named import blocks.
8
- "import/no-empty-named-blocks": ["warn"],
9
-
10
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
11
- // Forbid the use of extraneous packages.
12
- "import/no-extraneous-dependencies": [
13
- "error",
14
- { devDependencies: false, optionalDependencies: false, peerDependencies: false }
15
- ],
16
-
17
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
18
- // Forbid the use of mutable exports with var or let.
19
- "import/no-mutable-exports": ["error"],
20
-
21
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md
22
- // Forbid modules without exports, or exports without matching import in another module.
23
- // TODO: Can be enabled
24
- "import/no-unused-modules": ["off", { missingExports: true }],
25
-
26
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md
27
- // Forbid AMD require and define calls.
28
- "import/no-amd": ["error"],
29
-
30
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md
31
- // Forbid CommonJS require calls and module.exports or exports.*.
32
- "import/no-commonjs": ["error"],
33
-
34
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md
35
- // Forbid import statements with CommonJS module.exports.
36
- "import/no-import-module-exports": ["warn"],
37
-
38
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md
39
- // Forbid Node.js builtin modules.
40
- // TODO: Can enable for front-end
41
- "import/no-nodejs-modules": ["off"],
42
-
43
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md
44
- // Forbid potentially ambiguous parse goal (script vs. module).
45
- "import/unambiguous": ["error"],
46
-
47
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
48
- // Forbid import of modules using absolute paths.
49
- "import/no-absolute-path": ["warn"],
50
-
51
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
52
- // Forbid a module from importing a module with a dependency path back to itself.
53
- "import/no-cycle": ["error"],
54
-
55
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md
56
- // Forbid require() calls with expressions.
57
- "import/no-dynamic-require": ["off"],
58
-
59
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md
60
- // Forbid importing the submodules of other modules.
61
- // TODO: Must define in the project
62
- "import/no-internal-modules": ["off"],
63
-
64
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
65
- // Forbid importing packages through relative paths.
66
- "import/no-relative-packages": ["warn"],
67
-
68
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md
69
- // Forbid importing modules from parent directories.
70
- "import/no-relative-parent-imports": ["off"],
71
-
72
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md
73
- // Enforce which files can be imported in a given folder.
74
- // TODO: Can be customized
75
- // "import/no-restricted-paths": ["off"],
76
-
77
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
78
- // Forbid a module from importing itself.
79
- "import/no-self-import": ["error"],
80
-
81
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
82
- // Forbid unnecessary path segments in import and require statements.
83
- "import/no-useless-path-segments": [
84
- "warn",
85
- {
86
- noUselessIndex: true
87
- }
88
- ],
89
-
90
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md
91
- // Forbid webpack loader syntax in imports.
92
- "import/no-webpack-loader-syntax": ["error"],
93
-
94
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
95
- // Enforce or ban the use of inline type-only markers for named imports.
96
- "import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
97
-
98
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md
99
- // Enforce a leading comment with the webpackChunkName for dynamic imports.
100
- "import/dynamic-import-chunkname": ["error"],
101
-
102
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
103
- // Ensure all exports appear after other statements.
104
- // TODO: Can be enabled
105
- "import/exports-last": ["off"],
106
-
107
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
108
- // Ensure consistent use of file extension within the import path.
109
- "import/extensions": ["error", "never"],
110
-
111
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
112
- // Ensure all imports appear before other statements.
113
- "import/first": ["warn"],
114
-
115
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md
116
- // Prefer named exports to be grouped together in a single export declaration
117
- // TODO: Can be enabled
118
- "import/group-exports": ["off"],
119
-
120
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md
121
- // Enforce the maximum number of dependencies a module can have.
122
- "import/max-dependencies": ["off"],
123
-
124
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
125
- // Enforce a newline after import statements.
126
- "import/newline-after-import": ["warn"],
127
-
128
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-anonymous-default-export.md
129
- // Forbid anonymous values as default exports.
130
- "import/no-anonymous-default-export": ["error"],
131
-
132
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
133
- // Forbid default exports.
134
- "import/no-default-export": ["off"],
135
-
136
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md
137
- // Forbid named default exports.
138
- "import/no-named-default": ["off"],
139
-
140
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-export.md
141
- // Forbid named exports.
142
- "import/no-named-export": ["off"],
143
-
144
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-namespace.md
145
- // Forbid namespace (a.k.a. "wildcard" *) imports.
146
- "import/no-namespace": ["warn"],
147
-
148
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unassigned-import.md
149
- // Forbid unassigned imports
150
- "import/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
151
-
152
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
153
- // Enforce a convention in module import order.
154
- "import/order": ["warn"],
155
-
156
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md
157
- // Prefer a default export if module exports a single name or multiple names.
158
- "import/prefer-default-export": ["off"]
159
- };
1
+ export default {
2
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md
3
+ // Forbid imported names marked with @deprecated documentation tag.
4
+ "import/no-deprecated": ["error"],
5
+
6
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-empty-named-blocks.md
7
+ // Forbid empty named import blocks.
8
+ "import/no-empty-named-blocks": ["warn"],
9
+
10
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
11
+ // Forbid the use of extraneous packages.
12
+ "import/no-extraneous-dependencies": [
13
+ "error",
14
+ { devDependencies: false, optionalDependencies: false, peerDependencies: false }
15
+ ],
16
+
17
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
18
+ // Forbid the use of mutable exports with var or let.
19
+ "import/no-mutable-exports": ["error"],
20
+
21
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md
22
+ // Forbid modules without exports, or exports without matching import in another module.
23
+ // TODO: Can be enabled
24
+ "import/no-unused-modules": ["off", { missingExports: true }],
25
+
26
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md
27
+ // Forbid AMD require and define calls.
28
+ "import/no-amd": ["error"],
29
+
30
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md
31
+ // Forbid CommonJS require calls and module.exports or exports.*.
32
+ "import/no-commonjs": ["error"],
33
+
34
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md
35
+ // Forbid import statements with CommonJS module.exports.
36
+ "import/no-import-module-exports": ["warn"],
37
+
38
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md
39
+ // Forbid Node.js builtin modules.
40
+ // TODO: Can enable for front-end
41
+ "import/no-nodejs-modules": ["off"],
42
+
43
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md
44
+ // Forbid potentially ambiguous parse goal (script vs. module).
45
+ "import/unambiguous": ["error"],
46
+
47
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
48
+ // Forbid import of modules using absolute paths.
49
+ "import/no-absolute-path": ["warn"],
50
+
51
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
52
+ // Forbid a module from importing a module with a dependency path back to itself.
53
+ "import/no-cycle": ["error"],
54
+
55
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md
56
+ // Forbid require() calls with expressions.
57
+ "import/no-dynamic-require": ["off"],
58
+
59
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md
60
+ // Forbid importing the submodules of other modules.
61
+ // TODO: Must define in the project
62
+ "import/no-internal-modules": ["off"],
63
+
64
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
65
+ // Forbid importing packages through relative paths.
66
+ "import/no-relative-packages": ["warn"],
67
+
68
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md
69
+ // Forbid importing modules from parent directories.
70
+ "import/no-relative-parent-imports": ["off"],
71
+
72
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md
73
+ // Enforce which files can be imported in a given folder.
74
+ // TODO: Can be customized
75
+ // "import/no-restricted-paths": ["off"],
76
+
77
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
78
+ // Forbid a module from importing itself.
79
+ "import/no-self-import": ["error"],
80
+
81
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
82
+ // Forbid unnecessary path segments in import and require statements.
83
+ "import/no-useless-path-segments": [
84
+ "warn",
85
+ {
86
+ noUselessIndex: true
87
+ }
88
+ ],
89
+
90
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md
91
+ // Forbid webpack loader syntax in imports.
92
+ "import/no-webpack-loader-syntax": ["error"],
93
+
94
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
95
+ // Enforce or ban the use of inline type-only markers for named imports.
96
+ "import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
97
+
98
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md
99
+ // Enforce a leading comment with the webpackChunkName for dynamic imports.
100
+ "import/dynamic-import-chunkname": ["error"],
101
+
102
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
103
+ // Ensure all exports appear after other statements.
104
+ // TODO: Can be enabled
105
+ "import/exports-last": ["off"],
106
+
107
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
108
+ // Ensure consistent use of file extension within the import path.
109
+ "import/extensions": ["error", "never"],
110
+
111
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
112
+ // Ensure all imports appear before other statements.
113
+ "import/first": ["warn"],
114
+
115
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md
116
+ // Prefer named exports to be grouped together in a single export declaration
117
+ // TODO: Can be enabled
118
+ "import/group-exports": ["off"],
119
+
120
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md
121
+ // Enforce the maximum number of dependencies a module can have.
122
+ "import/max-dependencies": ["off"],
123
+
124
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
125
+ // Enforce a newline after import statements.
126
+ "import/newline-after-import": ["warn"],
127
+
128
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-anonymous-default-export.md
129
+ // Forbid anonymous values as default exports.
130
+ "import/no-anonymous-default-export": ["error"],
131
+
132
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
133
+ // Forbid default exports.
134
+ "import/no-default-export": ["off"],
135
+
136
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md
137
+ // Forbid named default exports.
138
+ "import/no-named-default": ["off"],
139
+
140
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-export.md
141
+ // Forbid named exports.
142
+ "import/no-named-export": ["off"],
143
+
144
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-namespace.md
145
+ // Forbid namespace (a.k.a. "wildcard" *) imports.
146
+ "import/no-namespace": ["warn"],
147
+
148
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unassigned-import.md
149
+ // Forbid unassigned imports
150
+ "import/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
151
+
152
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
153
+ // Enforce a convention in module import order.
154
+ "import/order": ["warn"],
155
+
156
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md
157
+ // Prefer a default export if module exports a single name or multiple names.
158
+ "import/prefer-default-export": ["off"]
159
+ };
@@ -263,6 +263,10 @@ export default {
263
263
  {
264
264
  code: 120,
265
265
  tabWidth: 2,
266
+ comments: 120,
267
+ ignorePattern: true,
268
+ ignoreComments: true,
269
+ ignoreTrailingComments: true,
266
270
  ignoreUrls: true,
267
271
  ignoreStrings: true,
268
272
  ignoreTemplateLiterals: true,