@dg-scripts/eslint-config 5.21.6 → 5.21.7

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 (2) hide show
  1. package/index.js +5 -22
  2. package/package.json +12 -13
package/index.js CHANGED
@@ -1,31 +1,14 @@
1
1
  // @ts-check
2
- import path from 'node:path'
3
- import { fileURLToPath } from 'node:url'
4
- import antfu, { GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SRC, GLOB_TESTS, GLOB_TS, GLOB_TSX } from '@antfu/eslint-config'
5
- import { FlatCompat } from '@eslint/eslintrc'
2
+ import antfu, { GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SRC, GLOB_TESTS } from '@antfu/eslint-config'
6
3
  import eslintPluginPromise from 'eslint-plugin-promise'
7
4
  import eslintPluginSecurity from 'eslint-plugin-security'
8
5
  import eslintPluginTestingLibrary from 'eslint-plugin-testing-library'
9
6
  import { isPackageExists } from 'local-pkg'
10
7
 
11
- const baseDirectory = path.dirname(fileURLToPath(import.meta.url))
12
-
13
- const compat = new FlatCompat({
14
- baseDirectory,
15
- resolvePluginsRelativeTo: baseDirectory,
16
- })
17
-
18
8
  const eslintConfigNext
19
- = isPackageExists('next') && isPackageExists('eslint-config-next')
20
- ? compat.config({
21
- overrides: [
22
- {
23
- files: [GLOB_TS, GLOB_TSX],
24
- extends: 'next/core-web-vitals',
25
- },
26
- ],
27
- })
28
- : []
9
+ = isPackageExists('next') && isPackageExists('@next/eslint-plugin-next')
10
+ ? { nextjs: true }
11
+ : { nextjs: false }
29
12
 
30
13
  /** @type {import('@antfu/eslint-config').TypedFlatConfigItem} */
31
14
  const eslintConfigMarkdown = {
@@ -126,7 +109,6 @@ const eslintConfigRules = {
126
109
 
127
110
  /** @type {import('@antfu/eslint-config').TypedFlatConfigItem[]} */
128
111
  const eslintConfig = [
129
- ...eslintConfigNext,
130
112
  eslintConfigMarkdown,
131
113
  eslintConfigTestingLibrary,
132
114
  eslintConfigSecurity,
@@ -137,6 +119,7 @@ const eslintConfig = [
137
119
  /** @type {import('@antfu/eslint-config').OptionsConfig} */
138
120
  const eslintConfigAntfu = {
139
121
  react: true,
122
+ ...eslintConfigNext,
140
123
  formatters: {
141
124
  css: true,
142
125
  html: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dg-scripts/eslint-config",
3
3
  "type": "module",
4
- "version": "5.21.6",
4
+ "version": "5.21.7",
5
5
  "description": "ESLint configuration used by dg-scripts.",
6
6
  "author": "sabertazimi <sabertazimi@gmail.com>",
7
7
  "license": "MIT",
@@ -41,14 +41,14 @@
41
41
  "lint:fix": "eslint . --config=index.js --fix"
42
42
  },
43
43
  "peerDependencies": {
44
+ "@next/eslint-plugin-next": "^16.0.0",
44
45
  "eslint": "^9.0.0",
45
- "eslint-config-next": "^15.0.0",
46
- "next": "^15.0.0",
46
+ "next": "^16.0.0",
47
47
  "prettier": "^3.0.0",
48
48
  "typescript": "^5.0.0"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
- "eslint-config-next": {
51
+ "@next/eslint-plugin-next": {
52
52
  "optional": true
53
53
  },
54
54
  "next": {
@@ -56,16 +56,15 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
- "@antfu/eslint-config": "^5.2.0",
60
- "@eslint-react/eslint-plugin": "^1.52.3",
61
- "@eslint/eslintrc": "^3.3.1",
62
- "eslint-plugin-format": "^1.0.1",
59
+ "@antfu/eslint-config": "^6.2.0",
60
+ "@eslint-react/eslint-plugin": "^2.3.5",
61
+ "eslint-plugin-format": "^1.0.2",
63
62
  "eslint-plugin-promise": "^7.2.1",
64
- "eslint-plugin-react-hooks": "^5.2.0",
65
- "eslint-plugin-react-refresh": "^0.4.20",
63
+ "eslint-plugin-react-hooks": "^7.0.1",
64
+ "eslint-plugin-react-refresh": "^0.4.24",
66
65
  "eslint-plugin-security": "^3.0.1",
67
- "eslint-plugin-testing-library": "^7.6.3",
68
- "local-pkg": "^1.1.1"
66
+ "eslint-plugin-testing-library": "^7.13.4",
67
+ "local-pkg": "^1.1.2"
69
68
  },
70
- "gitHead": "813f614096aeb08e4bf0be0fa092eec94b51375d"
69
+ "gitHead": "10fa1fff5fd812bcbd27cb1ee393a158a3aab69e"
71
70
  }