@dg-scripts/eslint-config 5.16.0 → 5.17.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/CHANGELOG.md +17 -0
- package/index.js +48 -28
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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.17.0](https://github.com/sabertazimi/bod/compare/v5.16.0...v5.17.0) (2024-03-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update dependency @antfu/eslint-config to ^2.11.6 ([#1139](https://github.com/sabertazimi/bod/issues/1139)) ([623eab5](https://github.com/sabertazimi/bod/commit/623eab59fb89b5e834a189889513a1ce0b0b96c8))
|
|
12
|
+
* **eslint-config:** project config for type-aware rules ([#1138](https://github.com/sabertazimi/bod/issues/1138)) ([b1ab580](https://github.com/sabertazimi/bod/commit/b1ab58095ae9ab65b9498060cca58ff58b1d1002))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **eslint-config:** config for non type-aware rules ([#1141](https://github.com/sabertazimi/bod/issues/1141)) ([6900b0d](https://github.com/sabertazimi/bod/commit/6900b0de861644c61dd4baf9758ca7740330ccb9))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [5.16.0](https://github.com/sabertazimi/bod/compare/v5.15.2...v5.16.0) (2024-03-30)
|
|
7
24
|
|
|
8
25
|
|
package/index.js
CHANGED
|
@@ -11,37 +11,57 @@ const compat = new FlatCompat({
|
|
|
11
11
|
resolvePluginsRelativeTo: baseDirectory,
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
+
const eslintConfigNext = isPackageExists('next') && isPackageExists('eslint-config-next')
|
|
15
|
+
? compat.config({
|
|
16
|
+
overrides: [
|
|
17
|
+
{
|
|
18
|
+
files: '**/*.{ts,tsx}',
|
|
19
|
+
extends: 'next/core-web-vitals',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
})
|
|
23
|
+
: {}
|
|
24
|
+
|
|
25
|
+
/** @type {import('@antfu/eslint-config').OptionsConfig} */
|
|
26
|
+
const eslintConfigAntfu = {
|
|
27
|
+
react: true,
|
|
28
|
+
formatters: {
|
|
29
|
+
css: true,
|
|
30
|
+
html: true,
|
|
31
|
+
markdown: 'prettier',
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
|
|
36
|
+
const eslintConfigRules = {
|
|
37
|
+
rules: {
|
|
38
|
+
'style/brace-style': ['error', '1tbs'],
|
|
39
|
+
'ts/prefer-literal-enum-member': [
|
|
40
|
+
'error',
|
|
41
|
+
{
|
|
42
|
+
allowBitwiseExpressions: true,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** @type {import('@antfu/eslint-config').TypedFlatConfigItem[]} */
|
|
49
|
+
const eslintConfig = [
|
|
50
|
+
eslintConfigNext,
|
|
51
|
+
eslintConfigRules,
|
|
52
|
+
]
|
|
53
|
+
|
|
14
54
|
export default antfu(
|
|
15
55
|
{
|
|
16
56
|
typescript: {
|
|
17
|
-
tsconfigPath: 'tsconfig.json',
|
|
18
|
-
},
|
|
19
|
-
react: true,
|
|
20
|
-
formatters: {
|
|
21
|
-
css: true,
|
|
22
|
-
html: true,
|
|
23
|
-
markdown: 'prettier',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
isPackageExists('next') && isPackageExists('eslint-config-next')
|
|
27
|
-
? compat.config({
|
|
28
|
-
overrides: [
|
|
29
|
-
{
|
|
30
|
-
files: '**/*.{ts,tsx}',
|
|
31
|
-
extends: 'next/core-web-vitals',
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
})
|
|
35
|
-
: {},
|
|
36
|
-
{
|
|
37
|
-
rules: {
|
|
38
|
-
'style/brace-style': ['error', '1tbs'],
|
|
39
|
-
'ts/prefer-literal-enum-member': [
|
|
40
|
-
'error',
|
|
41
|
-
{
|
|
42
|
-
allowBitwiseExpressions: true,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
57
|
+
tsconfigPath: ['tsconfig.json', 'packages/*/tsconfig.json'],
|
|
45
58
|
},
|
|
59
|
+
...eslintConfigAntfu,
|
|
46
60
|
},
|
|
61
|
+
...eslintConfig,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
export const disableTypeAware = antfu(
|
|
65
|
+
eslintConfigAntfu,
|
|
66
|
+
...eslintConfig,
|
|
47
67
|
)
|
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.17.0",
|
|
5
5
|
"description": "ESLint configuration used by dg-scripts.",
|
|
6
6
|
"author": "sabertazimi <sabertazimi@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@antfu/eslint-config": "^2.11.
|
|
52
|
+
"@antfu/eslint-config": "^2.11.6",
|
|
53
53
|
"@eslint/eslintrc": "^3.0.2",
|
|
54
54
|
"eslint-plugin-format": "^0.1.0",
|
|
55
55
|
"eslint-plugin-react": "^7.34.1",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
58
58
|
"local-pkg": "^0.5.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "904c6046b63f9ea347320a6d8ba7c44d9d9fb617"
|
|
61
61
|
}
|