https://eslint.org/docs/latest/use/configure/configuration-files#configuration-file
37 lines
877 B
JavaScript
37 lines
877 B
JavaScript
import importPlugin from "eslint-plugin-import";
|
|
import reactPkg from "eslint-plugin-react";
|
|
const { configs: reactConfigs } = reactPkg;
|
|
import js from "@eslint/js";
|
|
import defineConfig from "./vite.config.js";
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
importPlugin.flatConfigs.recommended,
|
|
reactConfigs.flat.recommended,
|
|
reactConfigs.flat["jsx-runtime"],
|
|
{
|
|
files: ["**/*.{js,jsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
globals: {
|
|
console: "readonly"
|
|
}
|
|
},
|
|
settings: {
|
|
"import/resolver": {
|
|
vite: {
|
|
viteConfig: defineConfig({ mode: "development" })
|
|
}
|
|
}
|
|
},
|
|
rules: {
|
|
semi: "error",
|
|
"prefer-const": "error",
|
|
"no-unused-vars": "warn",
|
|
"import/no-dynamic-require": "warn",
|
|
"import/no-nodejs-modules": "warn",
|
|
}
|
|
}
|
|
];
|