43 lines
935 B
JavaScript
43 lines
935 B
JavaScript
|
|
// 配置参考: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,
|
|||
|
|
},
|
|||
|
|
globals: {
|
|||
|
|
uni: true,
|
|||
|
|
getCurrentPages: true,
|
|||
|
|
plus: true,
|
|||
|
|
wx: true,
|
|||
|
|
__BASE_URL__: true,
|
|||
|
|
},
|
|||
|
|
extends: ["eslint:recommended"],
|
|||
|
|
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,
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
});
|