31 lines
965 B
JavaScript
31 lines
965 B
JavaScript
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
import { FlatCompat } from "@eslint/eslintrc";
|
|
import mjs from "@eslint/js";
|
|
import prettierConfig from 'eslint-config-prettier';
|
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
recommendedConfig: mjs.configs.recommended
|
|
});
|
|
|
|
export default [
|
|
...compat.extends().map(
|
|
config => ({
|
|
...config,
|
|
files: ["**/*.mjs", "**/*.js", "**/*.cjs"],
|
|
rules: {
|
|
...config.rules,
|
|
// ...other your custom rules
|
|
"no-console": "warn",
|
|
"no-unused-vars": "warn",
|
|
"unused-imports/no-unused-imports": "error",
|
|
}
|
|
})
|
|
),
|
|
prettierConfig, // Turns off all ESLint rules that have the potential to interfere with Prettier rules.
|
|
eslintPluginPrettierRecommended
|
|
]; |