-
-
Save azu/aeefe6042ebb605400d10b2dbce50385 to your computer and use it in GitHub Desktop.
When use @typescript-eslint/eslint-recommended, can not set `prefer-const: warn`.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended'], | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaVersion: 2018, | |
sourceType: 'module', | |
}, | |
plugins: ['@typescript-eslint'], | |
rules: { | |
// .tsに対してはなぜか効いてない | |
'prefer-const': 'warn', | |
}, | |
overrides: [ | |
{ | |
files: ['**/*.ts'], | |
rules: { | |
// FIXME: .tsの場合に、rulesの設定がなぜかextendsしているplugin:@typescript-eslint/eslint-recommendedで上書きされてしまう | |
// https://github.com/typescript-eslint/typescript-eslint/blob/1765a178e456b152bd48192eb5db7e8541e2adf2/packages/eslint-plugin/src/configs/eslint-recommended.ts#L27-L28 | |
'prefer-const': 'warn', | |
'no-var': 'warn', | |
}, | |
}, | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment