@beyondessential/eslint-config-ts
Version:
Beyond Essential System's ESLint config for TypeScript/React.js
81 lines (80 loc) • 2.62 kB
JavaScript
module.exports = {
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb-typescript',
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:react/recommended',
],
plugins: ['import', 'react'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/space-before-blocks': 'off',
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
'@typescript-eslint/indent': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
},
],
'class-methods-use-this': 'off',
'import/order': 'warn',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: false, optionalDependencies: false, peerDependencies: false },
],
'max-classes-per-file': 'off',
'no-await-in-loop': 'off',
'no-continue': 'off',
'no-plusplus': 'off',
'no-prototype-builtins': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message:
'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message:
'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message:
'`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
'prettier/prettier': [
'error',
{ arrowParens: 'avoid', printWidth: 100, singleQuote: true, trailingComma: 'all' },
],
radix: 'off',
'react/forbid-prop-types': [
'error',
{ forbid: ['any'], checkContextTypes: true, checkChildContextTypes: true },
],
'react/jsx-filename-extension': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-did-update-set-state': 'off',
},
settings: {
react: {
version: '16.2',
},
},
};