eslint-config-seek 0.0.0-eslint-9-etc-20240918042509 → 0.0.0-eslint-9-etc-20240922064021

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/base.js +26 -36
  2. package/index.js +2 -10
  3. package/package.json +3 -6
package/base.js CHANGED
@@ -1,17 +1,9 @@
1
1
  const importX = require('eslint-plugin-import-x');
2
2
  const globals = require('globals');
3
- const tsParser = require('@typescript-eslint/parser');
4
3
  const jestPlugin = require('eslint-plugin-jest');
5
4
  const cypress = require('eslint-plugin-cypress');
6
- const js = require('@eslint/js');
7
-
8
- const { FlatCompat } = require('@eslint/eslintrc');
9
-
10
- const compat = new FlatCompat({
11
- baseDirectory: __dirname,
12
- recommendedConfig: js.configs.recommended,
13
- allConfig: js.configs.all,
14
- });
5
+ const eslintConfigPrettier = require('eslint-config-prettier');
6
+ const tseslint = require('typescript-eslint');
15
7
 
16
8
  const OFF = 0;
17
9
  const ERROR = 2;
@@ -100,12 +92,17 @@ const settings = {
100
92
  };
101
93
 
102
94
  module.exports = [
103
- ...compat.extends('prettier', 'plugin:import-x/typescript'),
95
+ eslintConfigPrettier,
96
+ importX.flatConfigs.typescript,
97
+ {
98
+ ...importX.flatConfigs.errors,
99
+ files: [`**/*.{${jsExtensions}}`],
100
+ },
101
+ {
102
+ ...importX.flatConfigs.warnings,
103
+ files: [`**/*.{${jsExtensions}}`],
104
+ },
104
105
  {
105
- plugins: {
106
- 'import-x': importX,
107
- },
108
-
109
106
  languageOptions: {
110
107
  globals: {
111
108
  ...globals.node,
@@ -120,21 +117,20 @@ module.exports = [
120
117
  settings,
121
118
  rules: baseRules,
122
119
  },
123
- ...compat
124
- .extends(
125
- 'plugin:@typescript-eslint/recommended',
126
- 'plugin:@typescript-eslint/stylistic',
127
- 'prettier',
128
- )
129
- .map((config) => ({
120
+ ...[...tseslint.configs.recommended, ...tseslint.configs.stylistic].map(
121
+ (config) => ({
130
122
  ...config,
131
123
  files: [`**/*.{${tsExtensions}}`],
132
- })),
124
+ }),
125
+ ),
133
126
  {
134
127
  files: [`**/*.{${tsExtensions}}`],
128
+ plugins: {
129
+ 'import-x': importX,
130
+ },
135
131
 
136
132
  languageOptions: {
137
- parser: tsParser,
133
+ parser: tseslint.parser,
138
134
 
139
135
  parserOptions: {
140
136
  projectService: true,
@@ -191,12 +187,6 @@ module.exports = [
191
187
  'import-x/no-duplicates': [ERROR, { 'prefer-inline': true }],
192
188
  },
193
189
  },
194
- ...compat
195
- .extends('plugin:import-x/errors', 'plugin:import-x/warnings')
196
- .map((config) => ({
197
- ...config,
198
- files: [`**/*.{${jsExtensions}}`],
199
- })),
200
190
  {
201
191
  files: [`**/*.{${jsExtensions}}`],
202
192
  languageOptions: {
@@ -214,13 +204,13 @@ module.exports = [
214
204
  'import-x/no-duplicates': ERROR,
215
205
  },
216
206
  },
217
- ...compat.extends('plugin:jest/recommended').map((config) => ({
218
- ...config,
207
+ {
208
+ ...jestPlugin.configs['flat/recommended'],
219
209
  files: [
220
210
  `**/__tests__/**/*.{${allExtensions}}`,
221
211
  `**/*.@(spec|test).{${allExtensions}}`,
222
212
  ],
223
- })),
213
+ },
224
214
  {
225
215
  files: [
226
216
  `**/__tests__/**/*.{${allExtensions}}`,
@@ -233,10 +223,10 @@ module.exports = [
233
223
  },
234
224
  },
235
225
  },
236
- ...compat.extends('plugin:cypress/recommended').map((config) => ({
237
- ...config,
226
+ {
227
+ ...cypress.configs.recommended,
238
228
  files: [`**/cypress/**/*.{${allExtensions}}`],
239
- })),
229
+ },
240
230
  {
241
231
  files: [`**/cypress/**/*.{${allExtensions}}`],
242
232
  plugins: { cypress },
package/index.js CHANGED
@@ -4,15 +4,6 @@ const base = require('./base');
4
4
  const { fixupPluginRules } = require('@eslint/compat');
5
5
 
6
6
  const globals = require('globals');
7
- const js = require('@eslint/js');
8
-
9
- const { FlatCompat } = require('@eslint/eslintrc');
10
-
11
- const compat = new FlatCompat({
12
- baseDirectory: __dirname,
13
- recommendedConfig: js.configs.recommended,
14
- allConfig: js.configs.all,
15
- });
16
7
 
17
8
  const OFF = 0;
18
9
  const ERROR = 2;
@@ -33,7 +24,8 @@ const reactRules = {
33
24
  };
34
25
 
35
26
  module.exports = [
36
- ...compat.extends('plugin:react/recommended', 'plugin:react/jsx-runtime'),
27
+ react.configs.flat.recommended,
28
+ react.configs.flat['jsx-runtime'],
37
29
  ...base,
38
30
  {
39
31
  plugins: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-seek",
3
- "version": "0.0.0-eslint-9-etc-20240918042509",
3
+ "version": "0.0.0-eslint-9-etc-20240922064021",
4
4
  "description": "ESLint configuration used by SEEK",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -20,14 +20,11 @@
20
20
  "homepage": "https://github.com/seek-oss/eslint-config-seek#readme",
21
21
  "dependencies": {
22
22
  "@eslint/compat": "^1.1.1",
23
- "@eslint/eslintrc": "^3.1.0",
24
- "@eslint/js": "^9.9.1",
25
- "@typescript-eslint/eslint-plugin": "^8.3.0",
26
- "@typescript-eslint/parser": "^8.3.0",
23
+ "typescript-eslint": "^8.6.0",
27
24
  "eslint-config-prettier": "^9.1.0",
28
25
  "eslint-import-resolver-typescript": "^3.6.3",
29
26
  "eslint-plugin-cypress": "^3.5.0",
30
- "eslint-plugin-import-x": "^4.0.0",
27
+ "eslint-plugin-import-x": "^4.2.1",
31
28
  "eslint-plugin-jest": "^28.8.0",
32
29
  "eslint-plugin-react": "^7.35.0",
33
30
  "eslint-plugin-react-hooks": "^4.6.2",