Update eslint to flat config
This commit is contained in:
@@ -1,22 +1,28 @@
|
||||
// eslint.config.js
|
||||
export default {
|
||||
env: {
|
||||
node: true,
|
||||
es2021: true,
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:prettier/recommended',
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
// eslint.config.js (flat config)
|
||||
import configRecommended from "eslint-config-eslint";
|
||||
import configPrettier from "eslint-config-prettier";
|
||||
import pluginPrettier from "eslint-plugin-prettier";
|
||||
import globals from "globals";
|
||||
import unusedImports from "eslint-plugin-unused-imports";
|
||||
import js from "@eslint/js";
|
||||
|
||||
export default [
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Add your custom rules here
|
||||
'no-console': 'warn',
|
||||
'no-unused-vars': 'warn',
|
||||
// Example: 'semi': ['error', 'always']
|
||||
"no-console": "warn",
|
||||
"no-unused-vars": "warn",
|
||||
"unused-imports/no-unused-imports": 1,
|
||||
},
|
||||
};
|
||||
|
||||
},
|
||||
js.configs.recommended,
|
||||
pluginPrettier.configs.recommended,
|
||||
configPrettier,
|
||||
unusedImports.configs.recommended,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user