Sorry, we don’t maintain typescript-ESLint, so we can’t be of much help
here. I’d suggest reaching out to the typescript-ESLint project directly
for help with this. Here’s a starting point:
https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md


On Sat, Mar 14, 2020 at 9:55 AM Bill Sorensen <[email protected]> wrote:

> I'm wanting to add @typescript-eslint/no-floating-promises to my rules and
> am having difficulties.
>
> That requires parserOptions.
>
> Here's my .eslintrc.js:
>
> module.exports = {
>   root: true,
>   parser: '@typescript-eslint/parser',
>   parserOptions: {
>     ecmaVersion: 2017,
>     project: './tsconfig.json'
>   },
>   plugins: [
>     '@typescript-eslint',
>   ],
>   extends: [
>     'eslint:recommended',
>     'plugin:@typescript-eslint/eslint-recommended',
>     'plugin:@typescript-eslint/recommended',
>     'prettier'
>   ],
>   rules: {
>     '@typescript-eslint/no-floating-promises': ['error'],
>     '@typescript-eslint/no-explicit-any': 'off'
>   }
> };
>
> and my tsconfig.json:
>
> {
>   "compilerOptions": {
>     "target": "ES2017",
>     "lib": ["ES2017"],
>     "module": "commonjs",
>     "declaration": true,
>     "outDir": "lib",
>     "removeComments": true,
>     "strict": true,
>     "noUnusedLocals": true,
>     "noUnusedParameters": true,
>     "noImplicitReturns": true,
>     "noFallthroughCasesInSwitch": true,
>     "moduleResolution": "node",
>     "esModuleInterop": true,
>     "forceConsistentCasingInFileNames": true
>   },
>   "include": ["src/**/*"],
>   "exclude": ["src/**/*.spec.ts"]
> }
>
> The catch is the *exclude*. I don't want my tests (specs) to be compiled
> to the outDir. But this causes the following error when I run ESLint:
>
> error  Parsing error: "parserOptions.project" has been set for
>> @typescript-eslint/parser.
>> The file does not match your project config: src/index.spec.ts.
>> The file must be included in at least one of the projects provided
>
>
> (Script is "lint": "eslint \"src/**/*.ts\"" )
>
> I *do* want to lint my tests.
>
> Everything worked fine until I added parserOptions - and I need that for
> the no-floating-promises rule.
>
> Any suggestions?
>
> --
> You received this message because you are subscribed to the Google Groups
> "ESLint" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/eslint/bf953e69-4a8c-481c-87de-a7850e0952f7%40googlegroups.com
> <https://groups.google.com/d/msgid/eslint/bf953e69-4a8c-481c-87de-a7850e0952f7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/eslint/CAOkd9hkW5xuoY8U3N4b%3DzoE-upbHz4wgTt2Nq%2Bn_5A1WsD9QBw%40mail.gmail.com.

Reply via email to