Skip to content

Commit

Permalink
Restore 2 eslint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
adbutterfield committed Jul 8, 2023
1 parent 53070e8 commit 862d98d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/.eslintrc.js
33 changes: 3 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
/** @type {import('eslint').Linter.Config} */

module.exports = {
ignorePatterns: '.eslintrc.js',
parser: '@typescript-eslint/parser',
extends: ['eslint/recommended', 'prettier'],
parserOptions: {
project: ['./tsconfig.json', './tsconfig.jest.json'],
tsconfigRootDir: __dirname,
ecmaVersion: 2015,
sourceType: 'module',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
// use <root>/tsconfig.json
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root/>@types` directory even it doesn't contain any source code, like `@types/unist`
},
},
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'react-app',
'plugin:prettier/recommended',
],
overrides: [
{
files: ['**/*.test.ts', '**/*.test.tsx'],
rules: {
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
},
},
],
};
35 changes: 35 additions & 0 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/** @type {import('eslint').Linter.Config} */

module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['../tsconfig.json', '../tsconfig.jest.json'],
tsconfigRootDir: __dirname,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
// use <root>/tsconfig.json
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root/>@types` directory even it doesn't contain any source code, like `@types/unist`
},
},
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'react-app',
'prettier',
],
overrides: [
{
files: ['**/*.test.ts', '**/*.test.tsx'],
rules: {
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
},
},
],
};

0 comments on commit 862d98d

Please sign in to comment.