@will-stone/eslint-config 6.11.0 → 7.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/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Will Stone
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,77 @@
1
- # ESLint Config
1
+ # @will-stone/eslint-config
2
2
 
3
- See parent [README](../../README.md)
3
+ My personal [ESLint](https://eslint.org/) config.
4
+
5
+ ## Usage
6
+
7
+ ### Install
8
+
9
+ ```bash
10
+ npm i -D eslint @will-stone/eslint-config
11
+ ```
12
+
13
+ ### Create config file
14
+
15
+ ```js
16
+ // eslint.config.js
17
+ import config from '@will-stone/eslint-config'
18
+
19
+ export default config()
20
+ ```
21
+
22
+ ### Add script for package.json
23
+
24
+ For example:
25
+
26
+ ```json
27
+ {
28
+ "scripts": {
29
+ "lint": "eslint .",
30
+ "lint:fix": "eslint . --fix"
31
+ }
32
+ }
33
+ ```
34
+
35
+ ### VS Code support (auto fix)
36
+
37
+ Install
38
+ [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).
39
+
40
+ Add the following settings to your `.vscode/settings.json`:
41
+
42
+ ```jsonc
43
+ {
44
+ // Enable the ESlint flat config support
45
+ "eslint.experimental.useFlatConfig": true
46
+ }
47
+ ```
48
+
49
+ ### Lint Staged
50
+
51
+ If you would like to apply lint and auto-fix before every commit, you can add
52
+ the following to your `package.json`:
53
+
54
+ ```json
55
+ {
56
+ "scripts": {
57
+ "prepare": "husky install"
58
+ },
59
+ "lint-staged": {
60
+ "*.{js,jsx,ts,tsx}": ["eslint --fix"]
61
+ }
62
+ }
63
+ ```
64
+
65
+ and then
66
+
67
+ ```bash
68
+ npm i -D husky lint-staged
69
+ npx husky install
70
+ npx husky add .husky/pre-commit "npx --no lint-staged"
71
+ ```
72
+
73
+ ## Credits
74
+
75
+ Inspired by the excellent
76
+ [Flat eslint-config](https://github.com/antfu/eslint-config) by
77
+ [Anthony Fu](https://github.com/antfu).