@frabbit/eslint-config 1.5.14 → 7.4.5

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2021-PRESENT 三咲智子 (https://github.com/sxzz)
3
+ Copyright © 2021-PRESENT Kevin Deng (https://github.com/sxzz)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,18 +1,22 @@
1
1
  # @frabbit/eslint-config [![npm](https://img.shields.io/npm/v/@frabbit/eslint-config.svg)](https://npmjs.com/package/@frabbit/eslint-config)
2
2
 
3
+
3
4
  Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.
4
5
  based on https://github.com/sxzz/eslint-config
5
6
 
6
- [Legacy Version](https://github.com/sxzz/eslint-config-legacy)
7
+ A opinionated ESLint config preset for JavaScript, TypeScript, Vue,
8
+ and Prettier.
7
9
 
8
10
  ## Features
9
11
 
10
12
  - Format with Prettier.
11
- - Designed to work with TypeScript, Vue 2 and 3 out-of-box.
13
+ - Designed to work with TypeScript, Vue out-of-box.
12
14
  - Support JSON(5), YAML, Markdown...
13
15
  - Sort imports, `package.json`, `tsconfig.json`...
14
16
  - [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
17
+ - Ignores common files like `dist`, `node_modules`, `coverage`, and files in `.gitignore`.
15
18
  - Reasonable defaults, best practices, only one-line of config
19
+ - Reasonable strict, but with better code quality.
16
20
 
17
21
  ## Install
18
22
 
@@ -20,54 +24,55 @@ based on https://github.com/sxzz/eslint-config
20
24
  npm i -D @frabbit/eslint-config
21
25
  ```
22
26
 
23
- Require Node.js >= 16.14.
27
+ Require Node.js >= 20.0.0, and ESLint >= 9.5.0.
24
28
 
25
29
  ## Usage
26
30
 
27
- ```js
28
- // eslint.config.js
29
- import { all } from '@frabbit/eslint-config'
30
-
31
- export default all
32
- ```
33
-
34
- ### Custom Config
35
-
36
31
  ```js
37
32
  import { frabbit } from '@frabbit/eslint-config'
38
33
  export default frabbit(
34
+ // Features: it'll detect installed dependency and enable necessary features automatically
35
+ {
36
+ prettier: true,
37
+ markdown: true,
38
+ vue: true, // auto detection
39
+ unocss: false, // auto detection
40
+ },
39
41
  [
40
42
  /* your custom config */
41
43
  ],
42
- { vue: true, prettier: true, markdown: true, unocss: false }
43
- )
44
+ ).removeRules('foo/bar') // see more in https://github.com/antfu/eslint-flat-config-utils
44
45
  ```
45
46
 
46
- ### VSCode
47
+ ### Presets
47
48
 
48
- ```jsonc
49
- {
50
- "eslint.experimental.useFlatConfig": true
51
- }
49
+ ```js
50
+ // eslint.config.js
51
+ import {
52
+ presetJavaScript, // Ignore common files and include javascript support
53
+ presetJsonc, // Includes basic json(c) file support and sorting json keys
54
+ presetLangsExtensions, // Includes markdown, yaml + `presetJsonc` support
55
+ presetBasic, // Includes `presetJavaScript` and typescript support
56
+
57
+ // Includes
58
+ // - `presetBasic` (JS+TS) support
59
+ // - `presetLangsExtensions` (markdown, yaml, jsonc) support
60
+ // - Vue support
61
+ // - UnoCSS support (`uno.config.ts` is required)
62
+ // - Prettier support
63
+ presetAll,
64
+ } from '@frabbit/eslint-config'
65
+
66
+ export default presetAll
52
67
  ```
53
68
 
69
+ See [preset.ts](./src/presets.ts) for more details.
70
+
54
71
  ## Comparing to [`@antfu/eslint-config`](https://github.com/antfu/eslint-config)
55
72
 
56
73
  Most of the rules are the same, but there are some differences:
57
74
 
58
- - Use Prettier instead of [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic).
59
- - Support both Vue 2 and Vue 3.
60
- - Support Vue Reactivity Transform.
61
- - More stricter rules.
62
-
63
- ## Sponsors
64
-
65
- <p align="center">
66
- <a href="https://cdn.jsdelivr.net/gh/frabbit/sponsors/sponsors.svg">
67
- <img src='https://cdn.jsdelivr.net/gh/frabbit/sponsors/sponsors.svg'/>
68
- </a>
69
- </p>
70
-
71
- ## License
75
+ - Use [Prettier](https://prettier.io/) instead of [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic).
76
+ - React and Svelte are not supported.
77
+ - Maybe stricter and simpler.
72
78
 
73
- [MIT](./LICENSE) License © 2021-PRESENT [三咲智子](https://github.com/frenchrabbit)