Open Serpentarius13 opened 8 months ago
- Can you reproduce it with cli
- Did you try to reload vscode or restart vscode-eslint extension
- Why you think it's an issue from this plugin instead of vscode-eslint extension
closed accidentally.
- You didnt answer my question
closed accidentally.
nest new
commandWhat is nest new
? Please run eslint
cli directly.
nest
is a cli for Nest.js, a Node framework. I've created a new node project with latest versions of packages and this config:
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
and .prettierrc:
{
"endOfLine": "auto",
"singleQuote": true,
"trailingComma": "all"
}
With it, there's a lot of red trails in my code:
But when I set option of endOfLine
setting to auto ('prettier/prettier': ['error', {"endOfLine": "auto"}]
), I get it still, only on the last line:
CLI output:
Don't paste codes here, how to reproduce in your reproduction repo?
Don't paste codes here, how to reproduce in your reproduction repo?
Don't you have any errors when you open up the project and install dependencies?
I need what commands to reproduce before involving.
I need what commands to reproduce before involving.
npm i
is enough I guess
eslint.
next?
eslint.
next?
Yep
nest
is a cli for Nest.js, a Node framework. I've created a new node project with latest versions of packages and this config:module.exports = { parser: '@typescript-eslint/parser', parserOptions: { project: 'tsconfig.json', tsconfigRootDir: __dirname, sourceType: 'module', }, plugins: ['@typescript-eslint/eslint-plugin'], extends: [ 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', ], root: true, env: { node: true, jest: true, }, ignorePatterns: ['.eslintrc.js'], rules: { '@typescript-eslint/interface-name-prefix': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', }, };
and .prettierrc:
{ "endOfLine": "auto", "singleQuote": true, "trailingComma": "all" }
With it, there's a lot of red trails in my code:
But when I set option of
endOfLine
setting to auto ('prettier/prettier': ['error', {"endOfLine": "auto"}]
), I get it still, only on the last line:CLI output:
I solve this issue writing this in my .eslintrc.js file, I paste all code:
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
"prettier/prettier": ["error", {"endOfLine": "auto"}],
},
};
this works perfectly
What version of
eslint
are you using?8.42.0
What version of
prettier
are you using?3.0.0
What version of
eslint-plugin-prettier
are you using?5.0.0
Please paste any applicable config files that you're using (e.g.
.prettierrc
or.eslintrc
files)What source code are you linting?
https://github.com/Serpentarius13/nest-eslint-error.
What did you expect to happen?
Linting for
endOfLine
choosing should turn itself off when providing such a setting. However (im using Webstorm) even after few reloads, cache clean, npm reinstall with node_modules removal, error still happens to me. Even with all possible fixes I've looked upon, its still happening:What actually happened?
Linting for EOL is not turning off and there's red underscores everywhere until I actually lint.