@ghettoddos/eslint-config 2.0.0 → 3.0.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/README.md CHANGED
@@ -73,7 +73,7 @@ Add the following settings to your `.vscode/settings.json`:
73
73
  "source.organizeImports": "never"
74
74
  },
75
75
 
76
- // Silent the stylistic rules in you IDE, but still auto fix them
76
+ // Silent the stylistic rules in your IDE, but still auto fix them
77
77
  "eslint.rules.customizations": [
78
78
  { "rule": "style/*", "severity": "off", "fixable": true },
79
79
  { "rule": "format/*", "severity": "off", "fixable": true },
@@ -131,7 +131,7 @@ Add the following settings to your `.zed/settings.json`:
131
131
  }
132
132
  },
133
133
 
134
- // Silent the stylistic rules in you IDE, but still auto fix them
134
+ // Silent the stylistic rules in your IDE, but still auto fix them
135
135
  "lsp": {
136
136
  "eslint": {
137
137
  "settings": {
@@ -193,6 +193,18 @@ export default config({
193
193
  // Type of the project. 'lib' for libraries, the default is 'app'
194
194
  type: 'lib',
195
195
 
196
+ // `.eslintignore` is no longer supported in Flat config, use `ignores` instead
197
+ // The `ignores` option in the option (first argument) is specifically treated to always be global ignores
198
+ // And will **extend** the config's default ignores, not override them
199
+ // You can also pass a function to modify the default ignores
200
+ ignores: [
201
+ '**/fixtures',
202
+ // ...globs
203
+ ],
204
+
205
+ // Parse the `.gitignore` file to get the ignores, on by default
206
+ gitignore: true,
207
+
196
208
  // Enable stylistic formatting rules
197
209
  // stylistic: true,
198
210
 
@@ -208,12 +220,6 @@ export default config({
208
220
  // Disable jsonc and yaml support
209
221
  jsonc: false,
210
222
  yaml: false,
211
-
212
- // `.eslintignore` is no longer supported in Flat config, use `ignores` instead
213
- ignores: [
214
- '**/fixtures',
215
- // ...globs
216
- ],
217
223
  })
218
224
  ```
219
225
 
@@ -255,6 +261,7 @@ import {
255
261
  ignores,
256
262
  imports,
257
263
  javascript,
264
+ jsdoc,
258
265
  jsonc,
259
266
  markdown,
260
267
  node,
@@ -265,13 +272,14 @@ import {
265
272
  typescript,
266
273
  unicorn,
267
274
  yaml,
268
- } from '@ghettoddo/eslint-config'
275
+ } from '@ghettoddos/eslint-config'
269
276
 
270
277
  export default combine(
271
278
  ignores(),
272
279
  javascript(/* Options */),
273
280
  comments(),
274
281
  node(),
282
+ jsdoc(),
275
283
  imports(),
276
284
  unicorn(),
277
285
  typescript(/* Options */),
@@ -300,6 +308,8 @@ Since flat config requires us to explicitly provide the plugin names (instead of
300
308
  | `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
301
309
  | `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
302
310
  | `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
311
+ | `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
312
+ | `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests) |
303
313
  | `next/*` | `@next/next` | [@next/eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
304
314
 
305
315
  When you want to override rules, or disable them inline, you need to update to the new prefix:
@@ -311,11 +321,11 @@ type foo = { bar: 2 }
311
321
  ```
312
322
 
313
323
  > [!NOTE]
314
- > About plugin renaming - it is actually rather a dangrous move that might leading to potential naming collisions, pointed out [here](https://github.com/eslint/eslint/discussions/17766) and [here](https://github.com/prettier/eslint-config-prettier#eslintconfigjs-flat-config-plugin-caveat). As this config also very **personal** and **opinionated**, I ambitiously position this config as the only **"top-level"** config per project, that might pivots the taste of how rules are named.
324
+ > About plugin renaming - it is actually rather a dangerous move that might lead to potential naming collisions, pointed out [here](https://github.com/eslint/eslint/discussions/17766) and [here](https://github.com/prettier/eslint-config-prettier#eslintconfigjs-flat-config-plugin-caveat). As this config also very **personal** and **opinionated**, I ambitiously position this config as the only **"top-level"** config per project, that might pivots the taste of how rules are named.
315
325
  >
316
326
  > This config cares more about the user-facings DX, and try to ease out the implementation details. For example, users could keep using the semantic `import/order` without ever knowing the underlying plugin has migrated twice to `eslint-plugin-i` and then to `eslint-plugin-import-x`. User are also not forced to migrate to the implicit `i/order` halfway only because we swapped the implementation to a fork.
317
327
  >
318
- > That said, it's probably still not a good idea. You might not want to doing this if you are maintaining your own eslint config.
328
+ > That said, it's probably still not a good idea. You might not want to do this if you are maintaining your own eslint config.
319
329
  >
320
330
  > Feel free to open issues if you want to combine this config with some other config presets but faced naming collisions. I am happy to figure out a way to make them work. But at this moment I have no plan to revert the renaming.
321
331
 
@@ -497,9 +507,13 @@ export default config({
497
507
  Auto-fixing for the following rules are disabled when ESLint is running in a code editor:
498
508
 
499
509
  - [`prefer-const`](https://eslint.org/docs/rules/prefer-const)
510
+ - [`test/no-only-tests`](https://github.com/levibuzolic/eslint-plugin-no-only-tests)
500
511
  - [`unused-imports/no-unused-imports`](https://www.npmjs.com/package/eslint-plugin-unused-imports)
512
+ - [`pnpm/json-enforce-catalog`](https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm#rules)
513
+ - [`pnpm/json-prefer-workspace-settings`](https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm#rules)
514
+ - [`pnpm/json-valid-catalog`](https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm#rules)
501
515
 
502
- They are no disabled, but made non-fixable using [this helper](https://github.com/antfu/eslint-flat-config-utils#composerdisablerulesfix).
516
+ > Since v2.0.0, they are no longer disabled, but made non-fixable using [this helper](https://github.com/antfu/eslint-flat-config-utils#composerdisablerulesfix).
503
517
 
504
518
  This is to prevent unused imports from getting removed by the editor during refactoring to get a better developer experience. Those rules will be applied when you run ESLint in the terminal or [Lint Staged](#lint-staged). If you don't want this behavior, you can disable them:
505
519