Skip to content

Commit

Permalink
feat: add eslint9 config files
Browse files Browse the repository at this point in the history
  • Loading branch information
GZolla committed Nov 7, 2024
1 parent bbda455 commit 3ea4bf9
Show file tree
Hide file tree
Showing 8 changed files with 558 additions and 267 deletions.
29 changes: 29 additions & 0 deletions eslint9/browser-config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import parser from '@babel/eslint-parser';
import globals from 'globals';

import index from './index.mjs';
import oldConfig from '../browser-config.js';
import html from 'eslint-plugin-html';
import importPlugin from 'eslint-plugin-import';
import sortClassMembersPlugin from 'eslint-plugin-sort-class-members';

export default [
...index,
{
plugins: {
html,
'import': importPlugin,
'sort-class-members': sortClassMembersPlugin
},
languageOptions: {
parser,
parserOptions: oldConfig.parserOptions,
globals: {
...globals.browser,
...oldConfig.globals
},
},

'rules': oldConfig.rules
}
];
6 changes: 6 additions & 0 deletions eslint9/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import js from '@eslint/js';
import oldConfig from '../index.js';

export default [js.configs.recommended, {
rules: oldConfig.rules,
}];
11 changes: 11 additions & 0 deletions eslint9/lit-config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import browserConfig from './browser-config.mjs';
import oldConfig from '../lit-config.js';
import lit from "eslint-plugin-lit"
export default [
...browserConfig,
{
plugins: {lit}
},
{ rules:oldConfig.rules },
...oldConfig["overrides"].map(c => ({...c, files:[c.files]}))
];
17 changes: 17 additions & 0 deletions eslint9/node-config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import globals from 'globals';

import index from './index.mjs';
import oldConfig from '../node-config.js';
export default [
...index,
{
'languageOptions': {
'parserOptions': oldConfig.parserOptions,
'globals': {
...globals.node,
...globals.es2024
},
},
'rules': oldConfig.rules
}
];
22 changes: 22 additions & 0 deletions eslint9/react-config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import globals from 'globals';

import index from './index.mjs';
import oldConfig from '../react-config.js';
import react from 'eslint-plugin-react'

export default [
...index,
{
'languageOptions': {
'parserOptions': oldConfig.parserOptions,
'globals': {
...globals.browser,
...globals.es2015,
...globals.jest,
...globals.node,
},
'ecmaVersion': 6,
},
'plugins': {react}
}
];
16 changes: 16 additions & 0 deletions eslint9/testing-config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import globals from 'globals';

import litConfig from './lit-config.mjs';
import oldConfig from '../testing-config.js';

export default [
...litConfig,
{
'languageOptions': {
'globals': {
...globals.mocha,
}
},
'rules': oldConfig.rules
}
];
Loading

0 comments on commit 3ea4bf9

Please sign in to comment.