@dg-scripts/eslint-config 5.19.0 → 5.20.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/index.js +27 -4
  3. package/package.json +4 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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.0](https://github.com/sabertazimi/bod/compare/v5.19.0...v5.20.0) (2024-04-02)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **eslint-config:** require description rule ([#1162](https://github.com/sabertazimi/bod/issues/1162)) ([58d35e8](https://github.com/sabertazimi/bod/commit/58d35e8211aefe0bde523fba7da57c1b377e65b5))
12
+
13
+
14
+ ### Features
15
+
16
+ * **eslint-config:** add security and promise plugins ([#1163](https://github.com/sabertazimi/bod/issues/1163)) ([c9d49cf](https://github.com/sabertazimi/bod/commit/c9d49cfaed1b41364e620b120d359a1d4727868b))
17
+
18
+
19
+
20
+
21
+
6
22
  # [5.19.0](https://github.com/sabertazimi/bod/compare/v5.18.0...v5.19.0) (2024-04-01)
7
23
 
8
24
 
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,28 @@ const eslintConfigTestingLibrary = {
79
81
  },
80
82
  }
81
83
 
84
+ /** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
85
+ const eslintConfigSecurity = {
86
+ files: [GLOB_SRC],
87
+ ...eslintPluginSecurity.configs.recommended,
88
+ }
89
+
90
+ /** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
91
+ const eslintConfigPromise = {
92
+ files: [GLOB_SRC],
93
+ plugins: {
94
+ promise: eslintPluginPromise,
95
+ },
96
+ // @ts-expect-error -- Allow assign `string` (error/warn/off) to `RuleEntry`.
97
+ rules: {
98
+ ...eslintPluginPromise.configs.recommended.rules,
99
+ },
100
+ }
101
+
82
102
  /** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
83
103
  const eslintConfigRules = {
84
104
  rules: {
105
+ 'eslint-comments/require-description': 'error',
85
106
  'style/brace-style': ['error', '1tbs'],
86
107
  'ts/prefer-literal-enum-member': [
87
108
  'error',
@@ -94,9 +115,11 @@ const eslintConfigRules = {
94
115
 
95
116
  /** @type {import('@antfu/eslint-config').TypedFlatConfigItem[]} */
96
117
  const eslintConfig = [
97
- eslintConfigNext,
118
+ ...eslintConfigNext,
98
119
  eslintConfigMarkdown,
99
120
  eslintConfigTestingLibrary,
121
+ eslintConfigSecurity,
122
+ eslintConfigPromise,
100
123
  eslintConfigRules,
101
124
  ]
102
125
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dg-scripts/eslint-config",
3
3
  "type": "module",
4
- "version": "5.19.0",
4
+ "version": "5.20.0",
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": "40c7ca4f998d87ae1589b5c0d17c88260f84af48"
63
+ "gitHead": "9af8259eec1e14e0cfcf4f408f9599b9d245c394"
62
64
  }