Skip to content

Commit

Permalink
feat(typescript config): rules only for ts files
Browse files Browse the repository at this point in the history
  • Loading branch information
tutods committed Aug 15, 2023
1 parent 3d5b438 commit 82d5c48
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions packages/eslint-config/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,42 @@ try {
}

module.exports = {
extends: ['plugin:@typescript-eslint/recommended', './javascript'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
project: true,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/consistent-type-exports': [
'error',
{
fixMixedExportsWithInlineTypeSpecifier: false,
extends: ['./javascript'],
overrides: [
{
extends: ['plugin:@typescript-eslint/recommended'],
files: ['*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
project: true,
sourceType: 'module',
},
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/consistent-type-exports': [
'error',
{
fixMixedExportsWithInlineTypeSpecifier: false,
},
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-use-before-define': 'error',
},
],
'@typescript-eslint/no-use-before-define': 'error',
},
},
],
settings: {
'import/parsers': {
[require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.d.ts'],
Expand Down

0 comments on commit 82d5c48

Please sign in to comment.