it-console/code/ts/后端辅助工具/.eslintrc.js

62 lines
2.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author: Kane
* @Date: 2023-02-09 15:26:18
* @LastEditors: Kane
* @LastEditTime: 2023-02-18 23:36:07
* @FilePath: /后端辅助工具/.eslintrc.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
// project: ["./tsconfig.json",],
tsconfigRootDir: __dirname,
},
plugins: [
"@typescript-eslint",
],
extends: [
// "standard-with-typescript",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"no-console": "off",
"quote-props": ["warn", "as-needed",],
quotes: ["warn", "double", { allowTemplateLiterals: true, },],
indent: ["warn", 4,],
"no-unused-vars": "off",
semi: ["error", "always",], // 控制行尾部分号
"comma-dangle": ["error", {
arrays: "always",
objects: "always",
imports: "never",
exports: "never",
functions: "never",
},], // 数组和对象键值对最后一个逗号
"comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": ["error", "never",],
"no-undef-init": "error",
"no-invalid-this": "error",
"no-use-before-define": "error",
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等
// "comma-spacing": ["error", { "before": false, "after": true, },],
"brace-style": ["error", "allman", { allowSingleLine: true, },],
"prefer-const": "warn",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": "off",
},
};