@dendavidov/eslint-config-react 2.0.3 → 2.1.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/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  # @dendavidov/eslint-config-react
8
8
 
9
9
  Opinionated eslint-config for React.js SPA.
10
+ Includes security best-practice rules via `eslint-plugin-security`.
10
11
 
11
12
  ## Installation
12
13
 
@@ -17,6 +18,7 @@ npm i -D @dendavidov/eslint-config-react
17
18
  ## Usage
18
19
 
19
20
  Create `eslint.config.js` in the root of your project:
21
+
20
22
  ```javascript
21
23
  import config from '@dendavidov/eslint-config-react';
22
24
 
@@ -24,6 +26,7 @@ export default config;
24
26
  ```
25
27
 
26
28
  Or extend with your own rules:
29
+
27
30
  ```javascript
28
31
  import config from '@dendavidov/eslint-config-react';
29
32
 
@@ -32,12 +35,13 @@ export default [
32
35
  {
33
36
  rules: {
34
37
  // Your custom rules
35
- }
36
- }
38
+ },
39
+ },
37
40
  ];
38
41
  ```
39
42
 
40
43
  Add script to package.json:
44
+
41
45
  ```json
42
46
  {
43
47
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dendavidov/eslint-config-react",
3
- "version": "2.0.3",
3
+ "version": "2.1.1",
4
4
  "description": "Shareable ESLint config for React + TypeScript (ESLint 9+)",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -44,7 +44,8 @@
44
44
  "eslint-plugin-jest": "^29.0.1",
45
45
  "eslint-plugin-jsx-a11y": "^6.10.2",
46
46
  "eslint-plugin-react": "^7.37.5",
47
- "eslint-plugin-testing-library": "^7.5.4"
47
+ "eslint-plugin-testing-library": "^7.5.4",
48
+ "eslint-plugin-security": "^3.0.1"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@commitlint/cli": "^19.8.1",
@@ -63,6 +64,7 @@
63
64
  "eslint-plugin-testing-library": "^7.5.4",
64
65
  "husky": "^9.1.7",
65
66
  "jest": "^30.0.4",
66
- "prettier": "^3.6.2"
67
+ "prettier": "^3.6.2",
68
+ "eslint-plugin-security": "^3.0.1"
67
69
  }
68
70
  }
package/src/index.js CHANGED
@@ -2,6 +2,7 @@ import js from '@eslint/js';
2
2
  import reactPlugin from 'eslint-plugin-react';
3
3
  import importPlugin from 'eslint-plugin-import';
4
4
  import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
5
+ import securityPlugin from 'eslint-plugin-security';
5
6
  import tsPlugin from '@typescript-eslint/eslint-plugin';
6
7
  import tsParser from '@typescript-eslint/parser';
7
8
  import jestPlugin from 'eslint-plugin-jest';
@@ -11,6 +12,8 @@ import prettierConfig from 'eslint-config-prettier';
11
12
  export default [
12
13
  // core ESLint recommended
13
14
  js.configs.recommended,
15
+ // Security rules
16
+ securityPlugin.configs.recommended,
14
17
 
15
18
  // React configuration
16
19
  {