@luxass/eslint-config 4.3.7 → 4.4.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
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## ✨ Features
7
7
 
8
- - Based on [Antfu's ESLint Config](https://github.com/antfu/eslint-config) with some modifications
8
+ - Based on [antfu's ESLint Config](https://github.com/antfu/eslint-config) with some modifications
9
9
  - Auto fix for formatting (aimed to be used standalone **without** Prettier)
10
10
  - Designed to work with TypeScript, JSX, Vue out-of-box
11
11
  - Lints also for json, yaml, toml, markdown
@@ -15,7 +15,7 @@
15
15
  - [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
16
16
  - Using [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic)
17
17
  - Respects `.gitignore` by default
18
- - Optional [React](#react), [Svelte](#svelte), [UnoCSS](#unocss), [Astro](#astro) support
18
+ - Optional [React](#react), [Svelte](#svelte), [Solid](#solid), [UnoCSS](#unocss), [Astro](#astro) support
19
19
  - Optional [formatters](#formatters) support for CSS, HTML, etc.
20
20
 
21
21
  ## Usage
@@ -38,7 +38,7 @@ export default luxass()
38
38
  Combined with legacy config:
39
39
  </summary>
40
40
 
41
- If you still use some configs from the legacy eslintrc format, you can use the [`@eslint/eslintrc`](https://www.npmjs.com/package/@eslint/eslintrc) package to convert them to the flat config.
41
+ If you still use some configs from the legacy ESLint RC format, you can use the [`@eslint/eslintrc`](https://www.npmjs.com/package/@eslint/eslintrc) package to convert them to the flat config.
42
42
 
43
43
  ```js
44
44
  // eslint.config.mjs
@@ -255,16 +255,21 @@ Check out the [configs](https://github.com/luxass/eslint-config/blob/main/src/co
255
255
 
256
256
  ### Plugins Renaming
257
257
 
258
- Since flat config requires us to explicitly provide the plugin names (instead of mandatory convention from npm package name), we renamed some plugins to make overall scope more consistent and easier to write.
259
-
260
- | New Prefix | Original Prefix | Source Plugin |
261
- | ---------- | ---------------------- | ------------------------------------------------------------------------------------------ |
262
- | `import/*` | `import-x/*` | [eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x) |
263
- | `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
264
- | `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
265
- | `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
266
- | `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
267
- | `test/*` | `vitest/*` | [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) |
258
+ Since flat config requires us to explicitly provide the plugin names (instead of mandatory convention from NPM package name), we renamed some plugins to make overall scope more consistent and easier to write.
259
+
260
+ | New Prefix | Original Prefix | Source Plugin |
261
+ | --------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
262
+ | `import/*` | `import-x/*` | [eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x) |
263
+ | `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
264
+ | `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
265
+ | `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
266
+ | `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
267
+ | `test/*` | `vitest/*` | [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) |
268
+ | `react/*` | `@eslint-react/*` | [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) |
269
+ | `react-dom/*` | `@eslint-react/dom/*` | [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) |
270
+ | `react-hooks-extra/*` | `@eslint-react/hooks-extra/*` | [eslint-plugin-react-hooks-extra](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra) |
271
+ | `react-naming-convention/*` | `@eslint-react/naming-convention/*` | [eslint-plugin-react-naming-convention](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) |
272
+ | `nextjs` | `@next/next` | [eslint-plugin-react-refresh](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
268
273
 
269
274
  When you want to override rules, or disable them inline, you need to update to the new prefix:
270
275
 
@@ -275,11 +280,11 @@ type foo = { bar: 2 }
275
280
  ```
276
281
 
277
282
  > [!NOTE]
278
- > 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.
283
+ > 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 pivot the taste of how rules are named.
279
284
  >
280
285
  > 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.
281
286
  >
282
- > 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.
287
+ > 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.
283
288
  >
284
289
  > 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.
285
290
 
@@ -339,9 +344,9 @@ export default luxass({
339
344
  })
340
345
  ```
341
346
 
342
- ### Pipeline
347
+ ### Config Composer
343
348
 
344
- Since v4.3.0, the factory function `luxass()` returns a [pipeline object from `eslint-flat-config-utils`](https://github.com/antfu/eslint-flat-config-utils#pipe) where you can chain the methods to compose the config even more flexibly.
349
+ Since v4.3.0, the factory function `luxass()` returns a [`FlatConfigComposer` object from `eslint-flat-config-utils`](https://github.com/antfu/eslint-flat-config-utils#composer) where you can chain the methods to compose the config even more flexibly.
345
350
 
346
351
  ```js
347
352
  // eslint.config.js
@@ -374,7 +379,7 @@ We provide some optional configs for specific use cases, that we don't include t
374
379
 
375
380
  #### Formatters
376
381
 
377
- Use external formatters to format files that ESLint cannot handle yet (`.css`, `.html`, etc). Powered by [`eslint-plugin-format`](https://github.com/antfu/eslint-plugin-format).
382
+ Use external formatters to format files that ESLint cannot handle yet (`.css`, `.html`, etc.). Powered by [`eslint-plugin-format`](https://github.com/antfu/eslint-plugin-format).
378
383
 
379
384
  ```js
380
385
  // eslint.config.js
@@ -424,7 +429,7 @@ export default luxass({
424
429
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
425
430
 
426
431
  ```bash
427
- npm i -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh
432
+ npm i -D @eslint-react/eslint-plugin eslint-plugin-react-hooks eslint-plugin-react-refresh
428
433
  ```
429
434
 
430
435
  #### Next.JS
@@ -450,7 +455,7 @@ npm i -D eslint-plugin-react eslint-plugin-react-hooks @next/eslint-plugin-next
450
455
 
451
456
  #### Astro
452
457
 
453
- To enable astro support, you need to explicitly turn it on:
458
+ To enable Astro support, you need to explicitly turn it on:
454
459
 
455
460
  ```js
456
461
  // eslint.config.js
@@ -565,7 +570,7 @@ npx simple-git-hooks
565
570
 
566
571
  ## View what rules are enabled
567
572
 
568
- [Antfu](https://github.com/antfu) built a visual tool to help you view what rules are enabled in your project and apply them to what files, [@eslint/config-inspector](https://github.com/eslint/config-inspector)
573
+ [antfu](https://github.com/antfu) built a visual tool to help you view what rules are enabled in your project and apply them to what files, [@eslint/config-inspector](https://github.com/eslint/config-inspector)
569
574
 
570
575
  Go to your project root that contains `eslint.config.js` and run:
571
576