Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Commit

Permalink
Extract TS specific rules to overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
kaykayehnn committed Jun 23, 2019
1 parent 5c1da9f commit 20341eb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .eslintrc.js
Expand Up @@ -19,11 +19,19 @@ module.exports = {
},
overrides: [
{
files: ['*.js'],
// TypeScript-specific rules
files: ['*.{ts,tsx}'],
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
rules: {
// This is a workaround for ESLint not supporting extending overrides
// See https://github.com/eslint/eslint/issues/8813
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-interface': 'off',
},
},
{
Expand All @@ -35,11 +43,9 @@ module.exports = {
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
'prettier/react',
],
rules: {
Expand All @@ -51,12 +57,6 @@ module.exports = {
// Restricted globals rule
'no-restricted-globals': ['error'].concat(restrictedGlobals),
// Disabled rules from presets
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'react/prop-types': 'off',
'no-console': 'off',
// Other rules
Expand Down

0 comments on commit 20341eb

Please sign in to comment.