@etchteam/eslint-config 0.0.1 → 1.1.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/{src/.eslintrc.js → .eslintrc.js} +0 -0
- package/.github/{.mergify.yml → mergify.yml} +0 -0
- package/CHANGELOG.md +11 -0
- package/README.md +62 -3
- package/package.json +7 -1
- package/src/index.js +38 -3
|
File without changes
|
|
File without changes
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## [1.1.0](https://github.com/etchteam/eslint/compare/v1.0.3...v1.1.0) (2022-12-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* move @/ alias to the parent group ([8ee69c4](https://github.com/etchteam/eslint/commit/8ee69c4b372c688628b9303adc2568a490ff6709))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* rename mergify file ([93e057c](https://github.com/etchteam/eslint/commit/93e057cfada3644c636719251ff22dde52ab6ca4))
|
package/README.md
CHANGED
|
@@ -5,11 +5,70 @@ The eslint config that we use at [Etch](https://etch.co)
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install eslint @etchteam/eslint
|
|
8
|
+
npm install eslint prettier @etchteam/eslint-config
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Usage
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
echo "module.exports = { extends: ['@etchteam
|
|
14
|
+
echo "module.exports = { extends: ['@etchteam'] }" > .eslintrc.js
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### With lint-staged
|
|
18
|
+
|
|
19
|
+
#### New project
|
|
20
|
+
|
|
21
|
+
Run the following:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install husky lint-staged
|
|
25
|
+
|
|
26
|
+
echo "module.exports = { '*.{ts,tsx,js,jsx}': 'eslint --fix' };" > lint-staged.config.js
|
|
27
|
+
|
|
28
|
+
npx husky install
|
|
29
|
+
|
|
30
|
+
npx husky set .husky/pre-commit "npx --no-install -- lint-staged"
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Existing project with husky and lint staged
|
|
35
|
+
|
|
36
|
+
Add the following to your lint-staged config:
|
|
37
|
+
|
|
38
|
+
`'*.{ts,tsx,js,jsx}': 'eslint --fix'`
|
|
39
|
+
|
|
40
|
+
## Usage with VSCode
|
|
41
|
+
|
|
42
|
+
### New project with no VSCode config
|
|
43
|
+
|
|
44
|
+
Run the following:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
mkdir .vscode
|
|
48
|
+
|
|
49
|
+
echo "{ "editor.formatOnSave": false, "editor.codeActionsOnSave": { "source.fixAll.eslint": true } }" > .vscode/settings.json
|
|
50
|
+
|
|
51
|
+
# The VSCode prettier extension doesn't read the eslint config, so specific
|
|
52
|
+
# prettier overrides need to go in a prettier config for format on save
|
|
53
|
+
echo "module.exports = { singleQuote: true };" > prettier.config.js
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Exisiting project with VSCode config
|
|
58
|
+
|
|
59
|
+
Add the following to `.vscode/settings.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
"editor.formatOnSave": false,
|
|
63
|
+
"editor.codeActionsOnSave": {
|
|
64
|
+
"source.fixAll.eslint": true
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Run the following:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# The VSCode prettier extension doesn't read the eslint config, so specific
|
|
72
|
+
# prettier overrides need to go in a prettier config for format on save
|
|
73
|
+
echo "module.exports = { singleQuote: true };" > prettier.config.js
|
|
15
74
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etchteam/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Etch's standard eslint config",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"lint-staged": "^13.1.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
34
|
+
"@typescript-eslint/parser": "^5.46.1",
|
|
33
35
|
"eslint": "^8.29.0",
|
|
34
36
|
"eslint-config-next": "^13.0.7",
|
|
35
37
|
"eslint-config-prettier": "^8.5.0",
|
|
@@ -39,5 +41,9 @@
|
|
|
39
41
|
"eslint-plugin-storybook": "^0.6.8",
|
|
40
42
|
"eslint-plugin-unused-imports": "^2.0.0",
|
|
41
43
|
"prettier": "^2.8.1"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"eslint": "^8.29.0",
|
|
47
|
+
"prettier": "^2.8.1"
|
|
42
48
|
}
|
|
43
49
|
}
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'next/core-web-vitals',
|
|
4
|
+
'plugin:@typescript-eslint/recommended',
|
|
5
|
+
'plugin:storybook/recommended',
|
|
6
|
+
'plugin:security/recommended',
|
|
7
|
+
'plugin:import/recommended',
|
|
8
|
+
'plugin:import/typescript',
|
|
9
|
+
'plugin:prettier/recommended',
|
|
10
|
+
],
|
|
11
|
+
plugins: ['unused-imports'],
|
|
12
|
+
parser: '@typescript-eslint/parser',
|
|
13
|
+
rules: {
|
|
14
|
+
'no-unused-vars': 'off',
|
|
15
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
16
|
+
'unused-imports/no-unused-imports': 'error',
|
|
17
|
+
'unused-imports/no-unused-vars': 'off',
|
|
18
|
+
'import/order': ['error', {
|
|
19
|
+
'newlines-between': 'always',
|
|
20
|
+
alphabetize: {
|
|
21
|
+
order: 'asc'
|
|
22
|
+
},
|
|
23
|
+
pathGroups: [{
|
|
24
|
+
pattern: '@/**',
|
|
25
|
+
group: 'parent'
|
|
26
|
+
}]
|
|
27
|
+
}],
|
|
28
|
+
},
|
|
29
|
+
settings: {
|
|
30
|
+
'import/resolver': {
|
|
31
|
+
typescript: true,
|
|
32
|
+
node: true
|
|
33
|
+
},
|
|
34
|
+
'prettier/prettier': {
|
|
35
|
+
singleQuote: true,
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
};
|