@msobiecki/eslint-config 9.8.0 → 9.10.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [9.10.0](https://github.com/msobiecki/eslint-config/compare/v9.9.0...v9.10.0) (2025-10-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * update eslint 9 ([9287c29](https://github.com/msobiecki/eslint-config/commit/9287c296c228ba6b4cb7d06f5a38cac221d8f5a0))
7
+
8
+ # [9.9.0](https://github.com/msobiecki/eslint-config/compare/v9.8.0...v9.9.0) (2025-10-20)
9
+
10
+
11
+ ### Features
12
+
13
+ * update node ([a2eefd3](https://github.com/msobiecki/eslint-config/commit/a2eefd356940d535c9423b91e73b5135e5e36986))
14
+
1
15
  # [9.8.0](https://github.com/msobiecki/eslint-config/compare/v9.7.0...v9.8.0) (2025-10-20)
2
16
 
3
17
 
package/eslint.config.js CHANGED
@@ -82,6 +82,21 @@ export const bestPracticePreset = [
82
82
  "unicorn/no-array-for-each": "off",
83
83
  },
84
84
  },
85
+ {
86
+ name: "Filename Cases for JSX/TSX",
87
+ files: ["**/*.{jsx,tsx}"],
88
+ rules: {
89
+ "unicorn/filename-case": [
90
+ "error",
91
+ {
92
+ cases: {
93
+ camelCase: true,
94
+ pascalCase: true,
95
+ },
96
+ },
97
+ ],
98
+ },
99
+ },
85
100
  ];
86
101
 
87
102
  /**
@@ -98,6 +113,9 @@ export const reactPreset = [
98
113
  },
99
114
  languageOptions: {
100
115
  parserOptions: { ecmaFeatures: { jsx: true } },
116
+ globals: {
117
+ ...globals.browser,
118
+ },
101
119
  },
102
120
  rules: {
103
121
  ...reactBasePlugin.configs?.flat?.recommended?.rules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msobiecki/eslint-config",
3
- "version": "9.8.0",
3
+ "version": "9.10.0",
4
4
  "private": false,
5
5
  "description": "An ESLint shareable config for JavaScript/TypeScript ecosystem's.",
6
6
  "keywords": [
package/rules/node.js CHANGED
@@ -7,6 +7,12 @@ const nodeRules = {
7
7
 
8
8
  // disallow string concatenation with __dirname and __filename
9
9
  "n/no-path-concat": "error",
10
+
11
+ // disable no-missing-import rule as it is handled by import plugin
12
+ "n/no-missing-import": "off",
13
+
14
+ // disable n/no-missing-require rule as it is handled by import plugin
15
+ "n/no-missing-require": "off",
10
16
  };
11
17
 
12
18
  export default nodeRules;
package/rules/imports.js DELETED
@@ -1,273 +0,0 @@
1
- const importRules = {
2
- // Static analysis:
3
-
4
- // ensure imports point to files/modules that can be resolved
5
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
6
- "import/no-unresolved": ["error", { commonjs: true, caseSensitive: true }],
7
-
8
- // ensure named imports coupled with named exports
9
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
10
- "import/named": "error",
11
-
12
- // ensure default import coupled with default export
13
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
14
- "import/default": "off",
15
-
16
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/namespace.md
17
- "import/namespace": "off",
18
-
19
- // Helpful warnings:
20
-
21
- // disallow invalid exports, e.g. multiple defaults
22
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/export.md
23
- "import/export": "error",
24
-
25
- // do not allow a default import name to match a named export
26
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
27
- "import/no-named-as-default": "error",
28
-
29
- // warn on accessing default export property names that are also named exports
30
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
31
- "import/no-named-as-default-member": "error",
32
-
33
- // disallow use of jsdoc-marked-deprecated imports
34
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
35
- "import/no-deprecated": "off",
36
-
37
- // Forbid the use of extraneous packages
38
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
39
- // paths are treated both as absolute paths, and relative to process.cwd()
40
- "import/no-extraneous-dependencies": [
41
- "error",
42
- {
43
- devDependencies: [
44
- "test/**", // tape, common npm pattern
45
- "tests/**", // also common npm pattern
46
- "spec/**", // mocha, rspec-like pattern
47
- "**/__tests__/**", // jest pattern
48
- "**/__mocks__/**", // jest pattern
49
- "test.{js,jsx}", // repos with a single test file
50
- "test-*.{js,jsx}", // repos with multiple top-level test files
51
- "**/*{.,_}{test,spec}.{js,jsx}", // tests where the extension or filename suffix denotes that it is a test
52
- "**/jest.config.js", // jest config
53
- "**/jest.setup.js", // jest setup
54
- "**/vue.config.js", // vue-cli config
55
- "**/webpack.config.js", // webpack config
56
- "**/webpack.config.*.js", // webpack config
57
- "**/rollup.config.js", // rollup config
58
- "**/rollup.config.*.js", // rollup config
59
- "**/gulpfile.js", // gulp config
60
- "**/gulpfile.*.js", // gulp config
61
- "**/Gruntfile{,.js}", // grunt config
62
- "**/protractor.conf.js", // protractor config
63
- "**/protractor.conf.*.js", // protractor config
64
- "**/karma.conf.js", // karma config
65
- "**/.eslintrc.js", // eslint config
66
- ],
67
- optionalDependencies: false,
68
- },
69
- ],
70
-
71
- // Forbid mutable exports
72
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
73
- "import/no-mutable-exports": "error",
74
-
75
- // Module systems:
76
-
77
- // disallow require()
78
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
79
- "import/no-commonjs": "off",
80
-
81
- // disallow AMD require/define
82
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-amd.md
83
- "import/no-amd": "error",
84
-
85
- // No Node.js builtin modules
86
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
87
- // TODO: enable?
88
- "import/no-nodejs-modules": "off",
89
-
90
- // Style guide:
91
-
92
- // disallow non-import statements appearing before import statements
93
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/first.md
94
- "import/first": "error",
95
-
96
- // disallow non-import statements appearing before import statements
97
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/imports-first.md
98
- // deprecated: use `import/first`
99
- "import/imports-first": "off",
100
-
101
- // disallow duplicate imports
102
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
103
- "import/no-duplicates": "error",
104
-
105
- // disallow namespace imports
106
- // TODO: enable?
107
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
108
- "import/no-namespace": "off",
109
-
110
- // Ensure consistent use of file extension within the import path
111
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/extensions.md
112
- "import/extensions": [
113
- "error",
114
- "ignorePackages",
115
- {
116
- js: "never",
117
- mjs: "never",
118
- jsx: "never",
119
- },
120
- ],
121
-
122
- // ensure absolute imports are above relative imports and that unassigned imports are ignored
123
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/order.md
124
- // TODO: enforce a stricter convention in module import order?
125
- "import/order": ["error", { groups: [["builtin", "external", "internal"]] }],
126
-
127
- // Require a newline after the last import/require in a group
128
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
129
- "import/newline-after-import": "error",
130
-
131
- // Require modules with a single export to use a default export
132
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
133
- "import/prefer-default-export": "error",
134
-
135
- // Restrict which files can be imported in a given folder
136
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
137
- "import/no-restricted-paths": "off",
138
-
139
- // Forbid modules to have too many dependencies
140
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
141
- "import/max-dependencies": ["off", { max: 10 }],
142
-
143
- // Forbid import of modules using absolute paths
144
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
145
- "import/no-absolute-path": "error",
146
-
147
- // Forbid require() calls with expressions
148
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
149
- "import/no-dynamic-require": "error",
150
-
151
- // prevent importing the submodules of other modules
152
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
153
- "import/no-internal-modules": [
154
- "off",
155
- {
156
- allow: [],
157
- },
158
- ],
159
-
160
- // Warn if a module could be mistakenly parsed as a script by a consumer
161
- // leveraging Unambiguous JavaScript Grammar
162
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/unambiguous.md
163
- // this should not be enabled until this proposal has at least been *presented* to TC39.
164
- // At the moment, it's not a thing.
165
- "import/unambiguous": "off",
166
-
167
- // Forbid Webpack loader syntax in imports
168
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
169
- "import/no-webpack-loader-syntax": "error",
170
-
171
- // Prevent unassigned imports
172
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
173
- // importing for side effects is perfectly acceptable, if you need side effects.
174
- "import/no-unassigned-import": "off",
175
-
176
- // Prevent importing the default as if it were named
177
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
178
- "import/no-named-default": "error",
179
-
180
- // Reports if a module's default export is unnamed
181
- // https://github.com/import-js/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
182
- "import/no-anonymous-default-export": [
183
- "off",
184
- {
185
- allowArray: false,
186
- allowArrowFunction: false,
187
- allowAnonymousClass: false,
188
- allowAnonymousFunction: false,
189
- allowLiteral: false,
190
- allowObject: false,
191
- },
192
- ],
193
-
194
- // This rule enforces that all exports are declared at the bottom of the file.
195
- // https://github.com/import-js/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
196
- // TODO: enable?
197
- "import/exports-last": "off",
198
-
199
- // Reports when named exports are not grouped together in a single export declaration
200
- // or when multiple assignments to CommonJS module.exports or exports object are present
201
- // in a single file.
202
- // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
203
- "import/group-exports": "off",
204
-
205
- // forbid default exports. this is a terrible rule, do not use it.
206
- // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
207
- "import/no-default-export": "off",
208
-
209
- // Prohibit named exports. this is a terrible rule, do not use it.
210
- // https://github.com/import-js/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
211
- "import/no-named-export": "off",
212
-
213
- // Forbid a module from importing itself
214
- // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
215
- "import/no-self-import": "error",
216
-
217
- // Forbid cyclical dependencies between modules
218
- // https://github.com/import-js/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
219
- "import/no-cycle": ["error", { maxDepth: "∞" }],
220
-
221
- // Ensures that there are no useless path segments
222
- // https://github.com/import-js/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
223
- "import/no-useless-path-segments": ["error", { commonjs: true }],
224
-
225
- // dynamic imports require a leading comment with a webpackChunkName
226
- // https://github.com/import-js/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
227
- "import/dynamic-import-chunkname": [
228
- "off",
229
- {
230
- importFunctions: [],
231
- webpackChunknameFormat: "[0-9a-zA-Z-_/.]+",
232
- },
233
- ],
234
-
235
- // Use this rule to prevent imports to folders in relative parent paths.
236
- // https://github.com/import-js/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
237
- "import/no-relative-parent-imports": "off",
238
-
239
- // Reports modules without any exports, or with unused exports
240
- // https://github.com/import-js/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
241
- // TODO: enable once it supports CJS
242
- "import/no-unused-modules": [
243
- "off",
244
- {
245
- ignoreExports: [],
246
- missingExports: true,
247
- unusedExports: true,
248
- },
249
- ],
250
-
251
- // Reports the use of import declarations with CommonJS exports in any module except for the main module.
252
- // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-import-module-exports.md
253
- "import/no-import-module-exports": [
254
- "error",
255
- {
256
- exceptions: [],
257
- },
258
- ],
259
-
260
- // Use this rule to prevent importing packages through relative paths.
261
- // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-relative-packages.md
262
- "import/no-relative-packages": "error",
263
-
264
- // enforce a consistent style for type specifiers (inline or top-level)
265
- // https://github.com/import-js/eslint-plugin-import/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/consistent-type-specifier-style.md
266
- // TODO, semver-major: enable (just in case)
267
- "import/consistent-type-specifier-style": ["off", "prefer-inline"],
268
-
269
- // Reports the use of empty named import blocks.
270
- // https://github.com/import-js/eslint-plugin-import/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/no-empty-named-blocks.md
271
- // TODO, semver-minor: enable
272
- "import/no-empty-named-blocks": "off",
273
- };