Error with os-specific directory separators when using parserOptions.project
See original GitHub issueTell us about your environment
- ESLint Version: 7.12.0
- Node Version: 14.8.0
- npm Version: 6.14.7
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using? @typescript-eslint/parser
Please show your full configuration:
Configuration
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'c:/code/game/src/main.ts',
},
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-typescript',
],
rules: {
'import/prefer-default-export': 'off',
'import/no-unresolved': 'off',
'import/extensions': 'off',
'no-console': 'off',
},
};
package.json
{
"name": "game",
"version": "1.0.0",
"description": "",
"scripts": {
"build": "webpack --config webpack.config.js",
"start": "webpack-dev-server --config webpack.config.js --host 0.0.0.0"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.5.0",
"copy-webpack-plugin": "^6.2.1",
"electron": "^10.1.4",
"eslint": "^7.12.0",
"eslint-config-airbnb-typescript": "^12.0.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.8",
"ts-loader": "^8.0.6",
"typescript": "^4.0.3",
"webpack": "^5.2.0",
"webpack-cli": "3.3.12",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"pixi.js": "^5.3.3"
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
// Happens to every .ts file in codebase
npx eslint . --ext .ts
What did you expect to happen? Linting
What actually happened? Please include the actual, raw output from ESLint.
C:\Code\game\src\engine.ts
0:0 error Parsing error: Debug Failure. Expected c:/code/game/src/main.ts === c:\code\game\src\main.ts
C:\Code\game\src\main.ts
0:0 error Parsing error: Debug Failure. Expected c:/code/game/src/main.ts === c:\code\game\src\main.ts
... (same for every .ts file)
Are you willing to submit a pull request to fix this bug? No
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
"parserOptions.project" has been set for ... - Stack Overflow
The problem happens for one of the reasons below: You're using a rule which require type information and didn't specify a parserOptions.project ......
Read more >Local Install of ESLint Breaks In-Editor Linting
project`, all in-editor linting broke again and I just see an error at the very top of any given file that says `ESLint...
Read more >you have used a rule which requires parserservices to be ...
It seems to be a vue-specific problem as I am pulling in the eslint parser through vue-eslint-parser . tsconfig.json looks like this: { ......
Read more >WebStorm incorrectly builds the path to eslint's parserOptions ...
What steps will reproduce the problem? Set up a project with Typescript files and tsconfig.json in the /server directory. Add .eslintrc.js file to...
Read more >Ignoring Code - ESLint - Pluggable JavaScript Linter
You can tell ESLint to ignore specific files and directories using ignorePatterns in ... by creating a .eslintignore file in your project's root...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @qucumbah 😃 I will close the issue because it was found to be a wrong configuration problem(user error) (https://github.com/typescript-eslint/typescript-eslint/issues/2705#issuecomment-715988066). Please comment if there is anything we missed.
cc. @mdjermanovic
New issue in case you want to track it: https://github.com/typescript-eslint/typescript-eslint/issues/2705