@will-stone/eslint-config 0.3.0 → 0.5.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 ADDED
@@ -0,0 +1,74 @@
1
+ # @will-stone/eslint-config
2
+
3
+ ## Usage
4
+
5
+ ### Install
6
+
7
+ ```bash
8
+ npm i -D eslint @will-stone/eslint-config
9
+ ```
10
+
11
+ ### Create config file
12
+
13
+ ```js
14
+ // eslint.config.js
15
+ import config from '@will-stone/eslint-config'
16
+
17
+ export default config()
18
+ ```
19
+
20
+ ### Add script for package.json
21
+
22
+ For example:
23
+
24
+ ```json
25
+ {
26
+ "scripts": {
27
+ "lint": "eslint .",
28
+ "lint:fix": "eslint . --fix"
29
+ }
30
+ }
31
+ ```
32
+
33
+ ### VS Code support (auto fix)
34
+
35
+ Install
36
+ [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).
37
+
38
+ Add the following settings to your `.vscode/settings.json`:
39
+
40
+ ```jsonc
41
+ {
42
+ // Enable the ESlint flat config support
43
+ "eslint.experimental.useFlatConfig": true
44
+ }
45
+ ```
46
+
47
+ ### Lint Staged
48
+
49
+ If you would like to apply lint and auto-fix before every commit, you can add
50
+ the following to your `package.json`:
51
+
52
+ ```json
53
+ {
54
+ "scripts": {
55
+ "prepare": "husky install"
56
+ },
57
+ "lint-staged": {
58
+ "*.{js,jsx,ts,tsx}": ["eslint --fix"],
59
+ "*.{css,json,md}": ["prettier --write"]
60
+ }
61
+ }
62
+ ```
63
+
64
+ and then
65
+
66
+ ```bash
67
+ npm i -D husky lint-staged
68
+ ```
69
+
70
+ ## Credits
71
+
72
+ Inspired by the excellent
73
+ [Flat eslint-config](https://github.com/antfu/eslint-config) by
74
+ [Anthony Fu](https://github.com/antfu).