1- import eslintPluginJest from "eslint-plugin-jest" ;
2- import eslintPluginJs from "@eslint/js" ;
3- import eslintPluginPackageJson from "eslint-plugin-package-json" ;
4- import eslintPluginStylistic from "@stylistic/eslint-plugin" ;
1+ import { defineConfig , globalIgnores } from "eslint/config" ;
52import globals from "globals" ;
63import { flatConfigs as importX } from "eslint-plugin-import-x" ;
4+ import jest from "eslint-plugin-jest" ;
5+ import js from "@eslint/js" ;
6+ import packageJson from "eslint-plugin-package-json" ;
7+ import stylistic from "@stylistic/eslint-plugin" ;
78
8- const config = [
9- eslintPluginJest . configs [ "flat/recommended" ] ,
10- eslintPluginJs . configs . recommended ,
11- eslintPluginPackageJson . configs . recommended ,
12- eslintPluginStylistic . configs . all ,
13- importX . recommended ,
9+ export default defineConfig ( [
10+ globalIgnores ( [ "config/**" , "modules/**/*" , "!modules/default/**" , "js/positions.js" ] ) ,
1411 {
1512 files : [ "**/*.js" ] ,
1613 languageOptions : {
1714 ecmaVersion : "latest" ,
1815 globals : {
1916 ...globals . browser ,
2017 ...globals . node ,
21- ...globals . jest ,
2218 Log : "readonly" ,
2319 MM : "readonly" ,
2420 Module : "readonly" ,
2521 config : "readonly" ,
2622 moment : "readonly"
2723 }
2824 } ,
25+ plugins : { js, stylistic} ,
26+ extends : [ importX . recommended , jest . configs [ "flat/recommended" ] , "js/recommended" , "stylistic/all" ] ,
2927 rules : {
3028 "@stylistic/array-element-newline" : [ "error" , "consistent" ] ,
3129 "@stylistic/arrow-parens" : [ "error" , "always" ] ,
@@ -81,11 +79,15 @@ const config = [
8179 "no-warning-comments" : "off" ,
8280 "object-shorthand" : [ "error" , "methods" ] ,
8381 "one-var" : "off" ,
84- "prefer-destructuring" : "off" ,
8582 "prefer-template" : "error" ,
8683 "sort-keys" : "off"
8784 }
8885 } ,
86+ {
87+ files : [ "**/package.json" ] ,
88+ plugins : { packageJson} ,
89+ extends : [ "packageJson/recommended" ]
90+ } ,
8991 {
9092 files : [ "**/*.mjs" ] ,
9193 languageOptions : {
@@ -95,28 +97,25 @@ const config = [
9597 } ,
9698 sourceType : "module"
9799 } ,
100+ plugins : { js, stylistic} ,
101+ extends : [ importX . recommended , "js/all" , "stylistic/all" ] ,
98102 rules : {
99103 "@stylistic/array-element-newline" : "off" ,
100104 "@stylistic/indent" : [ "error" , "tab" ] ,
105+ "@stylistic/object-property-newline" : [ "error" , { allowAllPropertiesOnSameLine : true } ] ,
101106 "@stylistic/padded-blocks" : [ "error" , "never" ] ,
102107 "@stylistic/quote-props" : [ "error" , "as-needed" ] ,
103- "func-style " : "off" ,
108+ "import-x/no-unresolved " : [ "error" , { ignore : [ "eslint/config" ] } ] ,
104109 "max-lines-per-function" : [ "error" , 100 ] ,
105110 "no-magic-numbers" : "off" ,
106- "one-var" : "off" ,
107- "prefer-destructuring" : "off" ,
108- "sort-keys" : "error"
111+ "one-var" : [ "error" , "never" ] ,
112+ "sort-keys" : "off"
109113 }
110114 } ,
111115 {
112116 files : [ "tests/configs/modules/weather/*.js" ] ,
113117 rules : {
114118 "@stylistic/quotes" : "off"
115119 }
116- } ,
117- {
118- ignores : [ "config/**" , "modules/**/*" , "!modules/default/**" , "js/positions.js" ]
119120 }
120- ] ;
121-
122- export default config ;
121+ ] ) ;
0 commit comments