2023-04-20 14:28:29 +08:00
|
|
|
|
// 配置参考:https://eslint.bootcss.com/docs/user-guide/configuring
|
|
|
|
|
|
// import { defineConfig } from 'eslint-define-config';
|
|
|
|
|
|
const { defineConfig } = require("eslint-define-config");
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = defineConfig({
|
|
|
|
|
|
root: true,
|
|
|
|
|
|
env: {
|
|
|
|
|
|
node: true,
|
|
|
|
|
|
browser: true,
|
|
|
|
|
|
},
|
2023-04-20 17:38:14 +08:00
|
|
|
|
globals: {},
|
|
|
|
|
|
extends: [
|
|
|
|
|
|
"eslint:recommended",
|
|
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
|
|
"plugin:prettier/recommended",
|
|
|
|
|
|
],
|
2023-04-20 14:28:29 +08:00
|
|
|
|
parserOptions: {
|
|
|
|
|
|
ecmaVersion: "latest",
|
|
|
|
|
|
sourceType: "module",
|
|
|
|
|
|
ecmaFeatures: {
|
|
|
|
|
|
impliedStrict: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
|
|
|
|
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
|
|
|
|
},
|
|
|
|
|
|
overrides: [
|
|
|
|
|
|
{
|
|
|
|
|
|
files: [
|
|
|
|
|
|
"**/__tests__/*.{j,t}s?(x)",
|
|
|
|
|
|
"**/tests/unit/**/*.spec.{j,t}s?(x)",
|
|
|
|
|
|
],
|
|
|
|
|
|
env: {
|
|
|
|
|
|
mocha: true,
|
|
|
|
|
|
jest: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
});
|