@dg-scripts/eslint-config 5.19.0 → 5.20.1
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/CHANGELOG.md +27 -0
- package/index.js +29 -4
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.20.1](https://github.com/sabertazimi/bod/compare/v5.20.0...v5.20.1) (2024-04-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **eslint-config:** disable security rules for markdown codes ([#1164](https://github.com/sabertazimi/bod/issues/1164)) ([20987c2](https://github.com/sabertazimi/bod/commit/20987c27aa7b0c2b94fc638a0e92b75cf30817d1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [5.20.0](https://github.com/sabertazimi/bod/compare/v5.19.0...v5.20.0) (2024-04-02)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **eslint-config:** require description rule ([#1162](https://github.com/sabertazimi/bod/issues/1162)) ([58d35e8](https://github.com/sabertazimi/bod/commit/58d35e8211aefe0bde523fba7da57c1b377e65b5))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **eslint-config:** add security and promise plugins ([#1163](https://github.com/sabertazimi/bod/issues/1163)) ([c9d49cf](https://github.com/sabertazimi/bod/commit/c9d49cfaed1b41364e620b120d359a1d4727868b))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [5.19.0](https://github.com/sabertazimi/bod/compare/v5.18.0...v5.19.0) (2024-04-01)
|
|
7
34
|
|
|
8
35
|
|
package/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
import { fileURLToPath } from 'node:url'
|
|
4
|
-
import antfu, { GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_TESTS, GLOB_TS, GLOB_TSX } from '@antfu/eslint-config'
|
|
4
|
+
import antfu, { GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SRC, GLOB_TESTS, GLOB_TS, GLOB_TSX } from '@antfu/eslint-config'
|
|
5
5
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
6
|
+
import eslintPluginPromise from 'eslint-plugin-promise'
|
|
7
|
+
import eslintPluginSecurity from 'eslint-plugin-security'
|
|
6
8
|
import eslintPluginTestingLibrary from 'eslint-plugin-testing-library'
|
|
7
9
|
import { isPackageExists } from 'local-pkg'
|
|
8
10
|
|
|
@@ -23,7 +25,7 @@ const eslintConfigNext
|
|
|
23
25
|
},
|
|
24
26
|
],
|
|
25
27
|
})
|
|
26
|
-
:
|
|
28
|
+
: []
|
|
27
29
|
|
|
28
30
|
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
|
|
29
31
|
const eslintConfigMarkdown = {
|
|
@@ -33,7 +35,7 @@ const eslintConfigMarkdown = {
|
|
|
33
35
|
|
|
34
36
|
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
|
|
35
37
|
const eslintConfigTestingLibrary = {
|
|
36
|
-
files: GLOB_TESTS,
|
|
38
|
+
files: [...GLOB_TESTS],
|
|
37
39
|
plugins: {
|
|
38
40
|
'testing-library': eslintPluginTestingLibrary,
|
|
39
41
|
},
|
|
@@ -79,9 +81,30 @@ const eslintConfigTestingLibrary = {
|
|
|
79
81
|
},
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
|
|
85
|
+
const eslintConfigSecurity = {
|
|
86
|
+
files: [GLOB_SRC],
|
|
87
|
+
ignores: [GLOB_MARKDOWN_CODE, `${GLOB_MARKDOWN}/**/*.vue`],
|
|
88
|
+
...eslintPluginSecurity.configs.recommended,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
|
|
92
|
+
const eslintConfigPromise = {
|
|
93
|
+
files: [GLOB_SRC],
|
|
94
|
+
ignores: [GLOB_MARKDOWN_CODE, `${GLOB_MARKDOWN}/**/*.vue`],
|
|
95
|
+
plugins: {
|
|
96
|
+
promise: eslintPluginPromise,
|
|
97
|
+
},
|
|
98
|
+
// @ts-expect-error -- Allow assign `string` (error/warn/off) to `RuleEntry`.
|
|
99
|
+
rules: {
|
|
100
|
+
...eslintPluginPromise.configs.recommended.rules,
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
|
|
82
104
|
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
|
|
83
105
|
const eslintConfigRules = {
|
|
84
106
|
rules: {
|
|
107
|
+
'eslint-comments/require-description': 'error',
|
|
85
108
|
'style/brace-style': ['error', '1tbs'],
|
|
86
109
|
'ts/prefer-literal-enum-member': [
|
|
87
110
|
'error',
|
|
@@ -94,9 +117,11 @@ const eslintConfigRules = {
|
|
|
94
117
|
|
|
95
118
|
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem[]} */
|
|
96
119
|
const eslintConfig = [
|
|
97
|
-
eslintConfigNext,
|
|
120
|
+
...eslintConfigNext,
|
|
98
121
|
eslintConfigMarkdown,
|
|
99
122
|
eslintConfigTestingLibrary,
|
|
123
|
+
eslintConfigSecurity,
|
|
124
|
+
eslintConfigPromise,
|
|
100
125
|
eslintConfigRules,
|
|
101
126
|
]
|
|
102
127
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dg-scripts/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.20.1",
|
|
5
5
|
"description": "ESLint configuration used by dg-scripts.",
|
|
6
6
|
"author": "sabertazimi <sabertazimi@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,11 +52,13 @@
|
|
|
52
52
|
"@antfu/eslint-config": "^2.11.6",
|
|
53
53
|
"@eslint/eslintrc": "^3.0.2",
|
|
54
54
|
"eslint-plugin-format": "^0.1.0",
|
|
55
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
55
56
|
"eslint-plugin-react": "^7.34.1",
|
|
56
57
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
57
58
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
59
|
+
"eslint-plugin-security": "^2.1.1",
|
|
58
60
|
"eslint-plugin-testing-library": "^6.2.0",
|
|
59
61
|
"local-pkg": "^0.5.0"
|
|
60
62
|
},
|
|
61
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "2ba8cd25304dbd4ed85771532dd6dc58f9bd548e"
|
|
62
64
|
}
|