eslint-config-conventions 1.1.2 → 4.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/.eslintrc.json +6 -4
- package/.github/workflows/lint.yml +2 -2
- package/.github/workflows/release.yml +2 -2
- package/.github/workflows/test.yml +2 -2
- package/.lintstagedrc.json +1 -1
- package/.markdownlint-cli2.jsonc +10 -0
- package/README.md +5 -5
- package/package.json +21 -21
- package/test/basic.js +4 -4
- package/test/fixtures/top-level-await.mjs +1 -1
- package/.markdownlint.json +0 -6
package/.eslintrc.json
CHANGED
|
@@ -145,6 +145,11 @@
|
|
|
145
145
|
"quote-props": ["error", "as-needed"],
|
|
146
146
|
"radix": "error",
|
|
147
147
|
"yoda": ["error", "never"],
|
|
148
|
+
"curly": ["error", "all"],
|
|
149
|
+
"func-style": ["error", "expression"],
|
|
150
|
+
"prefer-arrow-callback": "error",
|
|
151
|
+
"arrow-parens": ["error", "always"],
|
|
152
|
+
"arrow-body-style": ["error", "always"],
|
|
148
153
|
|
|
149
154
|
"import/no-absolute-path": "error",
|
|
150
155
|
"import/no-webpack-loader-syntax": "error",
|
|
@@ -247,6 +252,7 @@
|
|
|
247
252
|
"error",
|
|
248
253
|
"interface"
|
|
249
254
|
],
|
|
255
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
250
256
|
"@typescript-eslint/explicit-function-return-type": [
|
|
251
257
|
"error",
|
|
252
258
|
{
|
|
@@ -275,10 +281,6 @@
|
|
|
275
281
|
],
|
|
276
282
|
"@typescript-eslint/no-base-to-string": "error",
|
|
277
283
|
"@typescript-eslint/no-dynamic-delete": "error",
|
|
278
|
-
"@typescript-eslint/no-empty-interface": [
|
|
279
|
-
"error",
|
|
280
|
-
{ "allowSingleExtends": true }
|
|
281
|
-
],
|
|
282
284
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
283
285
|
"@typescript-eslint/no-extraneous-class": [
|
|
284
286
|
"error",
|
|
@@ -10,10 +10,10 @@ jobs:
|
|
|
10
10
|
lint:
|
|
11
11
|
runs-on: 'ubuntu-latest'
|
|
12
12
|
steps:
|
|
13
|
-
- uses: 'actions/checkout@
|
|
13
|
+
- uses: 'actions/checkout@v3.0.0'
|
|
14
14
|
|
|
15
15
|
- name: 'Use Node.js'
|
|
16
|
-
uses: 'actions/setup-node@
|
|
16
|
+
uses: 'actions/setup-node@v3.1.0'
|
|
17
17
|
with:
|
|
18
18
|
node-version: 'lts/*'
|
|
19
19
|
cache: 'npm'
|
|
@@ -8,13 +8,13 @@ jobs:
|
|
|
8
8
|
release:
|
|
9
9
|
runs-on: 'ubuntu-latest'
|
|
10
10
|
steps:
|
|
11
|
-
- uses: 'actions/checkout@
|
|
11
|
+
- uses: 'actions/checkout@v3.0.0'
|
|
12
12
|
with:
|
|
13
13
|
fetch-depth: 0
|
|
14
14
|
persist-credentials: false
|
|
15
15
|
|
|
16
16
|
- name: 'Use Node.js'
|
|
17
|
-
uses: 'actions/setup-node@
|
|
17
|
+
uses: 'actions/setup-node@v3.1.0'
|
|
18
18
|
with:
|
|
19
19
|
node-version: 'lts/*'
|
|
20
20
|
cache: 'npm'
|
|
@@ -10,10 +10,10 @@ jobs:
|
|
|
10
10
|
test:
|
|
11
11
|
runs-on: 'ubuntu-latest'
|
|
12
12
|
steps:
|
|
13
|
-
- uses: 'actions/checkout@
|
|
13
|
+
- uses: 'actions/checkout@v3.0.0'
|
|
14
14
|
|
|
15
15
|
- name: 'Use Node.js'
|
|
16
|
-
uses: 'actions/setup-node@
|
|
16
|
+
uses: 'actions/setup-node@v3.1.0'
|
|
17
17
|
with:
|
|
18
18
|
node-version: 'lts/*'
|
|
19
19
|
cache: 'npm'
|
package/.lintstagedrc.json
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"*": ["editorconfig-checker"],
|
|
3
3
|
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"],
|
|
4
4
|
"*.{json,jsonc,yml,yaml}": ["prettier --write"],
|
|
5
|
-
"*.{md,mdx}": ["prettier --write", "markdownlint --
|
|
5
|
+
"*.{md,mdx}": ["prettier --write", "markdownlint-cli2 --fix"]
|
|
6
6
|
}
|
package/README.md
CHANGED
|
@@ -41,9 +41,9 @@ Here is an example, but use it only for reference, because your decisions regard
|
|
|
41
41
|
```sh
|
|
42
42
|
npm install --save-dev \
|
|
43
43
|
eslint@^8.9.0 \
|
|
44
|
-
eslint-plugin-import@^2.
|
|
44
|
+
eslint-plugin-import@^2.26.0 \
|
|
45
45
|
eslint-plugin-promise@^6.0.0 \
|
|
46
|
-
eslint-plugin-unicorn@^
|
|
46
|
+
eslint-plugin-unicorn@^43.0.0 \
|
|
47
47
|
eslint-config-conventions@latest
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -62,9 +62,9 @@ If you want to use **TypeScript**, you also need to install:
|
|
|
62
62
|
|
|
63
63
|
```sh
|
|
64
64
|
npm install --save-dev \
|
|
65
|
-
typescript@^4.
|
|
66
|
-
@typescript-eslint/eslint-plugin@^5.
|
|
67
|
-
@typescript-eslint/parser@^5.
|
|
65
|
+
typescript@^4.8.2 \
|
|
66
|
+
@typescript-eslint/eslint-plugin@^5.36.1 \
|
|
67
|
+
@typescript-eslint/parser@^5.36.1
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
Dependencies are:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-conventions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"public": true,
|
|
5
5
|
"description": "ESLint shareable config to enforce strict conventions and good code quality.",
|
|
6
6
|
"author": "Divlo <contact@divlo.fr>",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"lint:commit": "commitlint",
|
|
32
32
|
"lint:editorconfig": "editorconfig-checker",
|
|
33
|
-
"lint:markdown": "markdownlint
|
|
33
|
+
"lint:markdown": "markdownlint-cli2",
|
|
34
34
|
"lint:javascript": "eslint \"**/*.{js,jsx,ts,tsx}\" -c \"eslintrc.json\"",
|
|
35
35
|
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\"",
|
|
36
36
|
"lint:staged": "lint-staged",
|
|
@@ -42,29 +42,29 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"eslint": "^8.9.0",
|
|
45
|
-
"eslint-plugin-import": "^2.
|
|
45
|
+
"eslint-plugin-import": "^2.26.0",
|
|
46
46
|
"eslint-plugin-promise": "^6.0.0",
|
|
47
|
-
"eslint-plugin-unicorn": "^
|
|
47
|
+
"eslint-plugin-unicorn": "^43.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@commitlint/cli": "
|
|
51
|
-
"@commitlint/config-conventional": "
|
|
52
|
-
"@types/eslint": "8.4.
|
|
53
|
-
"@types/tap": "15.0.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
55
|
-
"@typescript-eslint/parser": "5.
|
|
50
|
+
"@commitlint/cli": "17.1.2",
|
|
51
|
+
"@commitlint/config-conventional": "17.1.0",
|
|
52
|
+
"@types/eslint": "8.4.6",
|
|
53
|
+
"@types/tap": "15.0.7",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "5.36.1",
|
|
55
|
+
"@typescript-eslint/parser": "5.36.1",
|
|
56
56
|
"editorconfig-checker": "4.0.2",
|
|
57
|
-
"eslint": "8.
|
|
58
|
-
"eslint-plugin-import": "2.
|
|
59
|
-
"eslint-plugin-promise": "6.0.
|
|
60
|
-
"eslint-plugin-unicorn": "
|
|
61
|
-
"husky": "
|
|
62
|
-
"lint-staged": "
|
|
63
|
-
"markdownlint-
|
|
57
|
+
"eslint": "8.23.0",
|
|
58
|
+
"eslint-plugin-import": "2.26.0",
|
|
59
|
+
"eslint-plugin-promise": "6.0.1",
|
|
60
|
+
"eslint-plugin-unicorn": "43.0.2",
|
|
61
|
+
"husky": "8.0.1",
|
|
62
|
+
"lint-staged": "13.0.3",
|
|
63
|
+
"markdownlint-cli2": "0.5.1",
|
|
64
64
|
"pinst": "3.0.0",
|
|
65
|
-
"prettier": "2.
|
|
66
|
-
"semantic-release": "19.0.
|
|
67
|
-
"tap": "16.
|
|
68
|
-
"typescript": "4.
|
|
65
|
+
"prettier": "2.7.1",
|
|
66
|
+
"semantic-release": "19.0.5",
|
|
67
|
+
"tap": "16.3.0",
|
|
68
|
+
"typescript": "4.8.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/test/basic.js
CHANGED
|
@@ -2,13 +2,13 @@ const tap = require('tap')
|
|
|
2
2
|
|
|
3
3
|
const config = require('../index.js')
|
|
4
4
|
|
|
5
|
+
const isObject = (object) => {
|
|
6
|
+
return typeof object === 'object' && object !== null
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
tap.test('test basic properties of config', async (t) => {
|
|
6
10
|
t.ok(isObject(config.parserOptions))
|
|
7
11
|
t.ok(isObject(config.env))
|
|
8
12
|
t.ok(isObject(config.rules))
|
|
9
13
|
t.ok(isObject(config.overrides))
|
|
10
14
|
})
|
|
11
|
-
|
|
12
|
-
function isObject(object) {
|
|
13
|
-
return typeof object === 'object' && object !== null
|
|
14
|
-
}
|