eslint-config-dolmios 2.0.4 → 2.0.6

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
@@ -13,7 +13,7 @@ This ESLint configuration is designed for use with ESLint v9, which uses a flat
13
13
  ### Setting Up ESLint
14
14
  1. **Create an ESLint Configuration File**: In the root of your project, create a file named `eslint.config.js`.
15
15
 
16
- 2. **Import and Extend the Configuration**: Add the following content to `eslint.config.mjs` to use the `eslint-config-dolmios` configuration:
16
+ 2. **Import and Extend the Configuration**: Add the following content to `eslint.config.js` to use the `eslint-config-dolmios` configuration:
17
17
 
18
18
 
19
19
  ```js
@@ -25,6 +25,30 @@ export default [
25
25
  ];
26
26
  ```
27
27
 
28
+ ### Features
29
+
30
+ - **TypeScript Support**: Comprehensive TypeScript linting with strict type checking
31
+ - **React Best Practices**: Rules for React and React Hooks
32
+ - **Accessibility**: A11y rules to ensure your app is accessible
33
+ - **Next.js Optimization**: Includes Next.js Core Web Vitals rules for performance optimization
34
+ - **Code Organization**: Perfectionist plugin for consistent code organization
35
+ - **Modern JavaScript**: Enforces modern JavaScript practices
36
+
37
+ ### Next.js Compatibility
38
+
39
+ This configuration automatically detects your Next.js project structure and adjusts accordingly:
40
+
41
+ - **App Router Support**: Works with Next.js App Router projects
42
+ - **Pages Router Support**: Works with Next.js Pages Router projects
43
+ - **Non-Next.js Projects**: Works with regular React projects without Next.js
44
+
45
+ The configuration automatically detects:
46
+ - If you're using Next.js (by checking for `next.config.js`)
47
+ - If you're using App Router (by checking for an `app` directory)
48
+ - If you're using Pages Router (by checking for `pages` or `src/pages` directories)
49
+
50
+ Rules like `no-html-link-for-pages` are only enabled when a Pages Router is detected.
51
+
28
52
  ---
29
53
 
30
54
  ### Usage with Prettier
package/eslint.config.js CHANGED
@@ -28,8 +28,7 @@ export default [
28
28
  '**/eslint.config.js',
29
29
  '**/eslint.config.mjs',
30
30
  '**/eslint.config.cjs',
31
- '**/next.config.js',
32
- '**/next-sitemap.config.js'
31
+ '**/next.config.js'
33
32
  ],
34
33
  },
35
34
  {
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "eslint-config-dolmios",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "A simple ESLint config with Prettier and a couple TSConfig setups",
5
5
  "author": "Jackson Dolman <mail@dolmios.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/dolmios/eslint-config-dolmios/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@eslint/js": "^9.21.0",
11
- "@next/eslint-plugin-next": "^15.2.1",
12
- "@typescript-eslint/eslint-plugin": "^8.26.0",
13
- "@typescript-eslint/parser": "^8.26.0",
10
+ "@eslint/js": "^9.22.0",
11
+ "@next/eslint-plugin-next": "^15.2.2",
12
+ "@typescript-eslint/eslint-plugin": "^8.26.1",
13
+ "@typescript-eslint/parser": "^8.26.1",
14
14
  "eslint-plugin-jsx-a11y": "^6.10.2",
15
- "eslint-plugin-perfectionist": "^4.9.0",
15
+ "eslint-plugin-perfectionist": "^4.10.1",
16
16
  "eslint-plugin-react": "^7.37.4",
17
17
  "eslint-plugin-react-hooks": "^5.2.0",
18
18
  "globals": "^16.0.0"
19
19
  },
20
20
  "devDependencies": {
21
- "eslint": "^9.21.0",
22
- "next": "^15.2.1",
21
+ "eslint": "^9.22.0",
22
+ "next": "^15.2.2",
23
23
  "prettier": "^3.5.3",
24
24
  "typescript": "^5.8.2"
25
25
  },
package/rules.js CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  // TypeScript specific rules
4
4
  const typescriptRules = {
5
+ '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': 'allow-with-description' }],
5
6
  '@typescript-eslint/explicit-function-return-type': 'warn',
7
+ '@typescript-eslint/no-explicit-any': 'warn',
8
+ '@typescript-eslint/no-inferrable-types': 'warn',
6
9
  '@typescript-eslint/no-non-null-assertion': 'warn',
7
10
  '@typescript-eslint/no-unused-vars': [
8
11
  'warn',
9
- { args: 'none', ignoreRestSiblings: true, argsIgnorePattern: '^_' },
12
+ { args: 'none', argsIgnorePattern: '^_', ignoreRestSiblings: true },
10
13
  ],
11
- '@typescript-eslint/no-explicit-any': 'warn',
12
- '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': 'allow-with-description' }],
13
- '@typescript-eslint/no-inferrable-types': 'warn',
14
14
  '@typescript-eslint/prefer-as-const': 'warn',
15
15
  'no-unused-vars': 'off',
16
16
  };
@@ -39,6 +39,8 @@ const a11yRules = {
39
39
 
40
40
  // React specific rules
41
41
  const reactRules = {
42
+ 'react-hooks/exhaustive-deps': 'warn',
43
+ 'react-hooks/rules-of-hooks': 'error',
42
44
  'react/button-has-type': 'warn',
43
45
  'react/destructuring-assignment': 'warn',
44
46
  'react/display-name': 'off',
@@ -73,27 +75,25 @@ const reactRules = {
73
75
  'react/sort-comp': 'warn',
74
76
  'react/style-prop-object': 'warn',
75
77
  'react/void-dom-elements-no-children': 'warn',
76
- 'react-hooks/exhaustive-deps': 'warn',
77
- 'react-hooks/rules-of-hooks': 'error',
78
78
  };
79
79
 
80
80
  // Next.js rules
81
81
  const nextRules = {
82
- '@next/next/no-html-link-for-pages': 'warn',
83
- '@next/next/no-img-element': 'warn',
84
- '@next/next/no-unwanted-polyfillio': 'warn',
85
- '@next/next/no-css-tags': 'warn',
86
- '@next/next/no-sync-scripts': 'warn',
87
82
  '@next/next/google-font-display': 'warn',
88
83
  '@next/next/google-font-preconnect': 'warn',
89
84
  '@next/next/next-script-for-ga': 'warn',
85
+ '@next/next/no-css-tags': 'warn',
86
+ '@next/next/no-html-link-for-pages': 'off',
87
+ '@next/next/no-img-element': 'warn',
90
88
  '@next/next/no-page-custom-font': 'warn',
89
+ '@next/next/no-sync-scripts': 'warn',
90
+ '@next/next/no-unwanted-polyfillio': 'warn',
91
91
  };
92
92
 
93
93
  // Perfectionist rules
94
94
  const perfectionistRules = {
95
- 'perfectionist/sort-objects': ['warn', { order: 'asc', type: 'natural' }],
96
95
  'perfectionist/sort-imports': ['warn', { order: 'asc', type: 'natural' }],
96
+ 'perfectionist/sort-objects': ['warn', { order: 'asc', type: 'natural' }],
97
97
  };
98
98
 
99
99
  // General JavaScript rules
@@ -113,7 +113,7 @@ const generalRules = {
113
113
  'no-label-var': 'warn',
114
114
  'no-labels': 'warn',
115
115
  'no-lone-blocks': 'warn',
116
- 'no-mixed-requires': ['warn', { grouping: true, allowCall: false }],
116
+ 'no-mixed-requires': ['warn', { allowCall: false, grouping: true }],
117
117
  'no-multi-spaces': 'warn',
118
118
  'no-multi-str': 'warn',
119
119
  'no-multiple-empty-lines': [