Skip to content

Commit

Permalink
chore(dips): bump eslint from 8 to 9, lint + prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mman authored Oct 1, 2024
1 parent a1e5338 commit 8543510
Show file tree
Hide file tree
Showing 42 changed files with 2,409 additions and 4,179 deletions.
66 changes: 0 additions & 66 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"semi": false
}
4 changes: 2 additions & 2 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"presets": [
["@babel/preset-react"], ["@babel/preset-env"]
["@babel/preset-react"], ["@babel/preset-env"]
],
"plugins": [
["@babel/plugin-transform-react-jsx", { "runtime": "automatic" }]
["@babel/plugin-transform-react-jsx", { "runtime": "automatic" }]
]
}
50 changes: 50 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const eslint = require('@eslint/js');
const babelParser = require('@babel/eslint-parser');
const reactPlugin = require('eslint-plugin-react');
const prettierPluginRecommended = require('eslint-plugin-prettier/recommended');
const globals = require('globals');
const confusingBrowserGlobals = require('confusing-browser-globals');

module.exports = [
eslint.configs.recommended,
prettierPluginRecommended,
{
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
plugins: {
react: reactPlugin,
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,
'no-unused-vars': ['error', { 'varsIgnorePattern': '^_', 'argsIgnorePattern': '^_' }]
},
languageOptions: {
parser: babelParser,
ecmaVersion: 2022,
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
},
}, {
files: ['src/client/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
languageOptions: {
globals: {
...globals.browser,
'VENUS_INFLUX_LOADER_ADMIN_API_PORT': true,
}
},
rules: {
'no-restricted-globals': ['error'].concat(confusingBrowserGlobals),
},
}, {
files: ['src/server/**/*.{js,jsx,mjs,cjs,ts,tsx}'],
languageOptions: {
globals: {
...globals.node,
}
}
}
]
Loading

0 comments on commit 8543510

Please sign in to comment.