123456789101112131415161718192021222324252627282930 |
- /* eslint-disable no-undef */
- module.exports = {
- env: {
- node: true,
- es6: true
- },
- parser: '@typescript-eslint/parser',
- parserOptions: {
- ecmaVersion: 2020,
- project: ['./tsconfig.json'],
- tsconfigRootDir: __dirname,
- projectFolderIgnoreList: ['**/node_modules/**', './dist/**', './db/*', './logs/*'],
- createDefaultProgram: true
- },
- plugins: ['@typescript-eslint'],
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended'
- ],
- rules: {
- 'no-var': 'error',
- 'no-extra-semi': 'off',
- 'quotes': [1, 'single'], // 必须使用单引号
- 'semi': [2, 'always'], //语句强制分号结尾
- 'max-len': ['warn', { code: 100, tabWidth: 2, ignoreUrls: true }],
- '@typescript-eslint/adjacent-overload-signatures': 'error', // 强制函数重载是连续的
- '@typescript-eslint/no-empty-function': 'off', // 允许空函数
- '@typescript-eslint/no-extra-semi': ['error'], // 多余分号去掉
- }
- };
|