pb-to-ts-api
Version:
help you transfer protobuf file to your custom d.ts and api request method
98 lines (97 loc) • 2.75 kB
JavaScript
const rules = require('./eslint-base-rules');
module.exports = {
root: true,
env: {
node: true,
browser: true,
commonjs: true,
es6: true,
jest: true,
},
extends: ['plugin:@typescript-eslint/recommended'],
plugins: ['@typescript-eslint', 'simple-import-sort'],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
tsx: true,
},
},
globals: {
wx: true,
getApp: true,
__wxConfig: true,
getCurrentPages: true,
GITCOMMITHASH: true,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
},
alias: {
map: [],
},
},
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
rules: {
...rules,
/** ---------------------- 团队内部覆盖 ---------------------- */
'no-unused-expressions': 'off',
'no-restricted-globals': 'off',
'no-console': 'off',
'no-bitwise': 'off',
'no-tabs': 'off',
'no-undef': 'error',
'no-param-reassign': 'off',
'array-callback-return': 'off',
'no-await-in-loop': 'off',
'no-nested-ternary': 'off',
'import/no-extraneous-dependencies': 'off',
'class-methods-use-this': 'off',
'id-match': 'off',
'comment-tatio': 'off',
'import/prefer-default-export': 'off',
'import/no-cycle': 'off',
'no-alert': 'off',
'function-paren-newline': 'off',
'operator-linebreak': ['error', 'before'],
'object-curly-newline': 'off',
'no-extra-semi': 'off',
'no-confusing-arrow': 'off',
'no-return-await': 'off',
'semi-style': 'off',
'implicit-arrow-linebreak': 'off',
'arrow-parens': 'off',
'no-unused-vars': 'off',
'no-restricted-syntax': 'off',
'brace-style': ['error', '1tbs'],
'max-len': [
'error',
{
code: 120,
ignoreStrings: true,
ignoreUrls: true,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
},
],
'prefer-destructuring': 'off',
'no-template-curly-in-string': 'off',
'no-useless-constructor': 'off',
'no-underscore-dangle': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-types': 'off',
},
};