profile
viewpoint
Brad Zacher bradzacher Software Engineer @Facebook Menlo Park, California, USA https://zacher.com.au Computer scientist. Cider drinker. Australian. Maintainer of @typescript-eslint. Software Engineer @facebook.

bradzacher/eslint-plugin-typescript 342

TypeScript plugin for ESLint

alexgorbatchev/eslint-import-resolver-typescript 178

This plugin adds TypeScript support to `eslint-plugin-import`.

bradzacher/mysqldump 125

Node Module to Create a Backup from MySQL

bradzacher/FioriBuildEnv 2

A gulp-based build environment for Fiori, including deployment to a ERP/Gateway server

bradzacher/HonsRecursiveSolverGE 1

Generate recursive C programs to solve a given problem

bradzacher/JavaFireworks 1

Simple 2D Fireworks using java's inbuilt graphics libraries

bradzacher/astexplorer 0

A web tool to explore the ASTs generated by various parsers.

bradzacher/babel 0

🐠 Babel is a compiler for writing next generation JavaScript.

bradzacher/cell-game 0

A simple cell based interactive 'game' reminiscent of pokemon. I created this for use as an interactive resume/showcase.

issue openedtypescript-eslint/typescript-eslint

Rule Proposal: Catch no await inside a catch block

consider the following code:

async function foo(val): number {
  if (!val) {
     throw new Error();
   }

  return 42;
}

async function bar1(): Promise<number> {
  try {
     return foo(0);
  } catch (err) {
     return -1;
  }
}

async function bar2(): Promise<number> {
  try {
     return await foo(0);
  } catch (err) {
     return -1;
  }
}

the function bar1() is probably a bug as it does not call await and the catch block will not be handled in the context of the function as intended while bar2() function is the current implementation.

eslint should probably warn about a potential error when evaluating bar1()

created time in an hour

issue commenttypescript-eslint/typescript-eslint

[no-redeclare] does not ignore type+namespace with ignoreDeclarationMerge

OK, that's a fair point... I see lots of such type+namespace combos used as sort of static method holders for union types, but this usage of class+namespace makes more sense.

paulius-valiunas

comment created time in 7 hours

issue commenttypescript-eslint/typescript-eslint

[no-redeclare] does not ignore type+namespace with ignoreDeclarationMerge

This isn't a declaration merge. A declaration merge is where the declarations get merged.

interface A { a: string }
interface A { b: string }

These are merged together into a single interface.

The combinations listed in the readme are the only possible declaration merges.

https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md#ignoredeclarationmerge

Your example is a redeclaration, and is ignored on purpose, as mentioned in the readme.

The problem is, it's NOT ignored. As per documentation:

When set to true, the rule will ignore declaration merges between the following sets:

  • interface + interface
  • namespace + namespace
  • class + interface
  • class + namespace
  • class + interface + namespace
  • function + namespace

Please explain to me, how is class + interface a declaration merge, but type alias + interface is not? How is it different?

paulius-valiunas

comment created time in 8 hours

issue openedtypescript-eslint/typescript-eslint

[no-unused-vars] false positive on nested namespace declaration

<!-- If you have a problem with a specific rule, please begin your issue title with [rulename] to make it easier to search for. I.e. "[no-unused-vars] False positive when fooing the bar"

Please don't ignore this template.

If you ignore it, we're just going to respond asking you to fill it out, which wastes everyone's time. The more relevant information you can include, the faster we can find the issue and fix it without asking you for more info. -->

<!-- Are you opening an issue because the rule you're trying to use is not found? 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

  1. Check the releases log: https://github.com/typescript-eslint/typescript-eslint/releases
    • If the rule isn't listed there, then chances are it hasn't been released to the main npm tag yet.
  2. Try installing the canary tag: npm i @typescript-eslint/eslint-plugin@canary.
    • The canary tag is built for every commit to master, so it contains the bleeding edge build.
  3. If ESLint still can't find the rule, then consider reporting an issue. -->
  • [X] I have tried restarting my IDE and the issue persists.
  • [X] I have updated to the latest version of the packages.
  • [X] I have read the FAQ and my problem is not listed.

Repro

<!-- Include a minimal reproduction case. The more irrelevant code/config you give, the harder it is for us to investigate.

Please consider creating an isolated reproduction repo to make it easy for the volunteer maintainers debug your issue. -->

{
  "rules": {
  }
}
// types.d.ts
export namespace a.b {
  type X = string;
}
// main.ts
import { a } from './types';

const x: a.b.X = 'foobar';

<!-- Also include your tsconfig, if you're using type-aware linting -->

Expected Result

b is clearly used, since removing it would cause a compile error, so no warning should appear

<!-- What did you expect to happen? Please be specific here - list the exact lines and messages you expect. -->

Actual Result

typescript-eslint reports a no-unused-vars warning on b, even though the namespace is used in the other file

<!-- What actually happened? Please be specific here - list the exact lines and messages that caused errors -->

Additional Info

<!-- Did eslint throw an exception?

Please run your lint again with the --debug flag, and dump the output below. i.e. eslint --ext ".ts,.js" src --debug -->

Versions

package version
@typescript-eslint/eslint-plugin 4.8.1
@typescript-eslint/parser 4.8.1
TypeScript 4.1.2
ESLint 7.13.0
node 15.1.0

created time in 12 hours

pull request commenttypescript-eslint/typescript-eslint

fix(typescript-estree): add default value for `parserOptions.projectFolderIgnoreList` and deduplicate resolved projects

Codecov Report

Merging #2819 (04118dc) into master (14758d2) will decrease coverage by 0.00%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2819      +/-   ##
==========================================
- Coverage   92.74%   92.74%   -0.01%     
==========================================
  Files         309      309              
  Lines       10320    10317       -3     
  Branches     2920     2920              
==========================================
- Hits         9571     9568       -3     
  Misses        346      346              
  Partials      403      403              
Flag Coverage Δ
unittest 92.74% <100.00%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ges/typescript-estree/src/create-program/shared.ts 87.87% <ø> (-0.70%) :arrow_down:
...-estree/src/create-program/createDefaultProgram.ts 76.19% <100.00%> (ø)
...pt-estree/src/create-program/createWatchProgram.ts 77.04% <100.00%> (-0.12%) :arrow_down:
bradzacher

comment created time in 19 hours

pull request commenttypescript-eslint/typescript-eslint

fix(typescript-estree): add default value for `parserOptions.projectFolderIgnoreList` and deduplicate resolved projects

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on <a href="https://opencollective.com/typescript-eslint" target="_blank" rel="noopener nofollow">https://opencollective.com/typescript-eslint</a>. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

bradzacher

comment created time in 20 hours

issue commenttypescript-eslint/typescript-eslint

Parser is looking in the wrong place for the tsconfig file

Thanks for digging into this and for updating my config! Did you discover any changes that I should be requesting within Narwhal Extensions in conjunction with the fix that you identified? I think that tsconfig.base.json is intentionally set up to be agnostic by Nx so that all of the various workspaces that they support don't run into issues, but I'm not 100% on that

Happy Thanksgiving!!

Tbhesswebber

comment created time in 20 hours

issue openedtypescript-eslint/typescript-eslint

[no-redeclare] does not ignore type+namespace with ignoreDeclarationMerge

<!-- If you have a problem with a specific rule, please begin your issue title with [rulename] to make it easier to search for. I.e. "[no-unused-vars] False positive when fooing the bar"

Please don't ignore this template.

If you ignore it, we're just going to respond asking you to fill it out, which wastes everyone's time. The more relevant information you can include, the faster we can find the issue and fix it without asking you for more info. -->

<!-- Are you opening an issue because the rule you're trying to use is not found? 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

  1. Check the releases log: https://github.com/typescript-eslint/typescript-eslint/releases
    • If the rule isn't listed there, then chances are it hasn't been released to the main npm tag yet.
  2. Try installing the canary tag: npm i @typescript-eslint/eslint-plugin@canary.
    • The canary tag is built for every commit to master, so it contains the bleeding edge build.
  3. If ESLint still can't find the rule, then consider reporting an issue. -->
  • [x] I have tried restarting my IDE and the issue persists.
  • [x] I have updated to the latest version of the packages.
  • [x] I have read the FAQ and my problem is not listed.

Repro

<!-- Include a minimal reproduction case. The more irrelevant code/config you give, the harder it is for us to investigate.

Please consider creating an isolated reproduction repo to make it easy for the volunteer maintainers debug your issue. -->

{
  "rules": {
    "@typescript-eslint/no-redeclare": [
      "error",
      {
        "ignoreDeclarationMerge": true,
      }
    ]
  }
}
export type A = string | number;
export namespace A {
}

<!-- Also include your tsconfig, if you're using type-aware linting -->

Expected Result

<!-- What did you expect to happen? Please be specific here - list the exact lines and messages you expect. --> No errors

Actual Result

<!-- What actually happened? Please be specific here - list the exact lines and messages that caused errors --> error @typescript-eslint/no-redeclare : 'A' is already defined. (at namespace declaration) Since the ignoreDeclarationMerge flag allows having a class and a namespace with the same name, I would expect it to allow having a type alias and a namespace too.

Versions

package version
@typescript-eslint/eslint-plugin 4.2.0
@typescript-eslint/parser 4.2.0
TypeScript 3.7.5
ESLint 7.14.0
node 12.18.4

created time in a day

issue commenttypescript-eslint/typescript-eslint

Parser is looking in the wrong place for the tsconfig file

I updated the non-overridden base config and am still seeing the behavior. The fact that it's essentially doing a path.join makes me wonder what's going on under the hood in other places... somehow the parser is looking in node_modules for tsconfig.base.json 🤔

# this is the path of the file being parsed
/Users/.../galvanize/apps/g-ent-desktop/src/environments/environment.ts

# this is the path of the eslint config file
/Users/.../galvanize/apps/g-ent-desktop/.eslintrc.json

# this is the path of the config file it extends
/Users/.../galvanize/.eslintrc.js

# this is the path of the tslint file that reads
/Users/.../galvanize/tsconfig.base.json

# this is the path from the error about not being able to read the file
/Users/.../galvanize/node_modules/tsconfig.base.json'
Tbhesswebber

comment created time in a day

issue openedtypescript-eslint/typescript-eslint

[no-unnecessary-type-assertion] false positive for querySelectorAll()

  • [ ] I have tried restarting my IDE and the issue persists.
  • [ ] I have updated to the latest version of the packages.
  • [ ] I have read the FAQ and my problem is not listed.

Repro

<!-- Include a minimal reproduction case. The more irrelevant code/config you give, the harder it is for us to investigate.

Please consider creating an isolated reproduction repo to make it easy for the volunteer maintainers debug your issue. -->

{
  "rules": {
    "@typescript-eslint/no-unnecessary-type-assertion": "error"
  }
}

tsconfig.json

{
	"compilerOptions": {
		"outDir": "../../public/js/compiled",
		"target": "es2020",
		"lib": ["dom", "es2015", "es2017"],
		"charset": "UTF-8",
		"newLine": "LF",
		"sourceMap": false,
		"allowJs": false,
		"checkJs": false,
		"noEmit": false,
		"esModuleInterop": false,
		"strict": true,
		"alwaysStrict": true,
		"removeComments": true,
		"noImplicitAny": true,
		"noImplicitReturns": true,
		"noImplicitThis": true,
		"strictNullChecks": true,
		"strictFunctionTypes": true,
		"allowUnusedLabels": false,
		"allowUnreachableCode": false,
		"noUnusedLocals": true,
		"noUnusedParameters": true
	},
	"include": [
		"./sources/"
	]
}
(document.body.querySelectorAll('input[name="foo"]') as NodeListOf<HTMLInputElement>).forEach(
	(input: HTMLInputElement): void =>
	{
		input.value = "some value";
	}
);

Expected Result

No error reported as .querySelectorAll() cannot know exactly what the result could be

Actual Result

This assertion is unnecessary since it does not change the type of the expression

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.8.0
@typescript-eslint/parser 4.8.0
TypeScript 4.1.2
ESLint 7.13.0
node 14.15.1

created time in a day

pull request commenttypescript-eslint/typescript-eslint

chore(eslint-plugin): [naming-convention] refactor rule to split it up

Codecov Report

Merging #2816 (fe42ba8) into master (6fc8409) will decrease coverage by 0.00%. The diff coverage is 94.82%.

@@            Coverage Diff             @@
##           master    #2816      +/-   ##
==========================================
- Coverage   92.74%   92.74%   -0.01%     
==========================================
  Files         302      309       +7     
  Lines       10269    10320      +51     
  Branches     2909     2920      +11     
==========================================
+ Hits         9524     9571      +47     
  Misses        346      346              
- Partials      399      403       +4     
Flag Coverage Δ
unittest 92.74% <94.82%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...plugin/src/rules/explicit-module-boundary-types.ts 88.74% <50.00%> (-0.53%) :arrow_down:
.../eslint-plugin/src/rules/triple-slash-reference.ts 93.54% <66.66%> (-3.12%) :arrow_down:
packages/eslint-plugin/src/rules/unbound-method.ts 93.10% <75.00%> (-1.96%) :arrow_down:
...plugin/src/rules/naming-convention-utils/format.ts 83.33% <83.33%> (ø)
...plugin/src/rules/naming-convention-utils/schema.ts 93.33% <93.33%> (ø)
...gin/src/rules/naming-convention-utils/validator.ts 95.48% <95.48%> (ø)
...lugin/src/rules/consistent-indexed-object-style.ts 89.36% <100.00%> (+0.47%) :arrow_up:
...eslint-plugin/src/rules/consistent-type-imports.ts 97.15% <100.00%> (+0.24%) :arrow_up:
...-plugin/src/rules/naming-convention-utils/enums.ts 100.00% <100.00%> (ø)
...-plugin/src/rules/naming-convention-utils/index.ts 100.00% <100.00%> (ø)
... and 10 more
bradzacher

comment created time in 2 days

pull request commenttypescript-eslint/typescript-eslint

chore(eslint-plugin): [naming-convention] refactor rule to split it up

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on <a href="https://opencollective.com/typescript-eslint" target="_blank" rel="noopener nofollow">https://opencollective.com/typescript-eslint</a>. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

bradzacher

comment created time in 2 days

issue commenttypescript-eslint/typescript-eslint

[naming-convention] Add the ability to lint namespace imports

Is there enough value in just ensuring the import name matches a format?

I think yes, because this

IMO the name of an import should be directly related to the thing being imported. I.e. it should be the filename

is very opinionated (although I support this viewpoint) and in some teams the naming style may differ.

vkrol

comment created time in 2 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add `import` selector

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on <a href="https://opencollective.com/typescript-eslint" target="_blank" rel="noopener nofollow">https://opencollective.com/typescript-eslint</a>. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

bradzacher

comment created time in 2 days

issue commenttypescript-eslint/typescript-eslint

Parser is looking in the wrong place for the tsconfig file

Thanks so much! Feel free to deprioritize this for the time being... it is a holiday week after all!

I pushed the changes recommended in those docs and still seem to have three locations where it isn't registering the update. It seems like these are changes that may need to be propagated over to nx, which I will definitely do once things are resolved.

Also, is this a place where following these directions for monorepos would be valuable? It feels like I'm right on the line to me.

Tbhesswebber

comment created time in 2 days

issue openedtypescript-eslint/typescript-eslint

Parser is looking in the wrong place for the tsconfig file

  • [x] I have tried restarting my IDE and the issue persists.
  • [x] I have updated to the latest version of the packages.
  • [x] I have read the FAQ and my problem is not listed.

Repro

I apologize for the size of this repro - I am in a weird spot where I am using (Narwhal Extensions)[nx.dev] with nx-electron and somehow the whole shebang has managed to cause the parser to lose track of the base tsconfig in some circumstances.

To run linting on every piece of the project, you have to run nx run-many --target lint --all --parallel (the parallel flag just speeds it all up).

This is a super greenfield POC that just got started, so it's essentially empty, but I'd be happy to jump into a chat to better understand/explain the problem in order to file a better issue with whomever the real culprit is if it's not the parser.

# error message being received (file paths are condensed)
...galvanize/apps/g-ent-e2e/src/integration/app.spec.ts
  0:0  error  Parsing error: Cannot read file '.../galvanize/node_modules/tsconfig.base.json'

Running with typescript-eslint in debug mode hasn't seemed to provide any clarity.

Expected Result

I expected the parser to look at the root of the workspace for tsconfig.base.json

Actual Result

A number of files are causing parsing errors at line 0 column 0 because the parser is looking for ./node_modules/tsconfig.base.json rather than ./tsconfig.base.json. This does not happen with all of the files.

Additional Info

There are a couple hundred more lines of output from running DEBUG=typescript-eslint:* nx run-many --target lint --all --parallel, but none seem to be concerning.

typescript-eslint:typescript-estree:createProjectProgram Creating project program for: /Users/tannerhesswebber/Documents/code/galvanize/galvanize/apps/g-ent-desktop/src/environments/environment.prod.ts +330ms
  typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. /users/tannerhesswebber/documents/code/galvanize/galvanize/apps/g-ent-desktop/src/environments/environment.prod.ts +330ms
  typescript-eslint:parser:parser Resolved libs from program: [ 'es2017', 'dom' ] +329ms

/Users/tannerhesswebber/Documents/code/galvanize/galvanize/apps/g-ent-desktop/src/environments/environment.ts
  0:0  error  Parsing error: Cannot read file '/users/tannerhesswebber/documents/code/galvanize/galvanize/node_modules/tsconfig.base.json'

Versions

package version
@typescript-eslint/parser 4.3.0
TypeScript 4.0.3
ESLint 7.10.0
node (system) 12.16.3
electron 7.1.0

created time in 2 days

issue commenttypescript-eslint/typescript-eslint

TypeScript 4.1 Syntax Support

With TypeScript 4.1 released, this issue is still closed, but I believe ESlint still breaks with:

from my package.json:

    "@typescript-eslint/eslint-plugin": "^4.8.2",
    "@typescript-eslint/parser": "^4.8.2",
    "eslint": "^7.14.0",
    "typescript": "^4.1.0"
bradzacher

comment created time in 2 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add `requiresQuotes` modifier

Codecov Report

Merging #2813 (1930e2a) into master (dd0576a) will decrease coverage by 0.02%. The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master    #2813      +/-   ##
==========================================
- Coverage   92.76%   92.74%   -0.03%     
==========================================
  Files         301      302       +1     
  Lines       10257    10269      +12     
  Branches     2905     2909       +4     
==========================================
+ Hits         9515     9524       +9     
- Misses        344      346       +2     
- Partials      398      399       +1     
Flag Coverage Δ
unittest 92.74% <95.23%> (-0.03%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nt-plugin/src/rules/switch-exhaustiveness-check.ts 98.00% <ø> (-0.28%) :arrow_down:
packages/eslint-plugin/src/util/requiresQuoting.ts 90.90% <90.90%> (ø)
...kages/eslint-plugin/src/rules/naming-convention.ts 89.27% <100.00%> (-0.22%) :arrow_down:
bradzacher

comment created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add `requiresQuotes` modifier

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on <a href="https://opencollective.com/typescript-eslint" target="_blank" rel="noopener nofollow">https://opencollective.com/typescript-eslint</a>. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

bradzacher

comment created time in 3 days

issue openedbradzacher/mysqldump

Generated columns cannot be inserted back into the table

Looking at the source code I couldn't see a place where generated columns are removed from SHOW COLUMS FROM table.

Generated columns are read-only and shouldn't be part of the dumper generated INSERTs.

created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add `requireDouble`, `allowDouble`, `allowSingleOrDouble` options for underscores

Codecov Report

Merging #2812 (3d7e25e) into master (6a06944) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2812      +/-   ##
==========================================
+ Coverage   92.74%   92.76%   +0.01%     
==========================================
  Files         301      301              
  Lines       10232    10257      +25     
  Branches     2902     2905       +3     
==========================================
+ Hits         9490     9515      +25     
  Misses        344      344              
  Partials      398      398              
Flag Coverage Δ
unittest 92.76% <100.00%> (+0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...kages/eslint-plugin/src/rules/naming-convention.ts 89.49% <100.00%> (+0.58%) :arrow_up:
bradzacher

comment created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add `requireDouble`, `allowDouble`, `allowSingleOrDouble` options for underscores

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on <a href="https://opencollective.com/typescript-eslint" target="_blank" rel="noopener nofollow">https://opencollective.com/typescript-eslint</a>. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

bradzacher

comment created time in 3 days

issue openedtypescript-eslint/typescript-eslint

error: Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.

Repro

Run eslint . --ext .js,.jsx,.ts,.tsx on the following codebase:

/.eslintrc.yaml

root: true
parser: "@typescript-eslint/parser"
parserOptions:
  project: "./tsconfig.json"
plugins:
  - "@typescript-eslint"
env:
  node: true

/tsconfig.json

{
  "compilerOptions": {
    "lib": ["es2019"],
    "module": "commonjs",
    "target": "es2019",
    "strict": true,
    "esModuleInterop": true,
    "allowJs": true,
    "checkJs": true,
    "baseUrl": "./"
  },
  "include": ["./**/*"],
  "exclude": ["./node_modules/**/*"]
}

/package.json

{
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "4.8.2",
    "@typescript-eslint/parser": "4.8.2",
    "eslint": "7.14.0",
    "typescript": "4.1.2"
  }
}

/src/Foo.ts

export default function foo(): string {
  return "";
}

/src/Foo.js

export default function foo() {
  return "";
}

Expected Result

eslint to succeed.

Actual Result

eslint fails due to Foo.js not being included within the project (even though it's covered by my "include" settings):

/Users/lawrence/Repositories/playground/eslint-js-example/src/Foo.js
  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src/Foo.js.
The file must be included in at least one of the projects provided

✖ 1 problem (1 error, 0 warnings)

Versions

package version
@typescript-eslint/parser 4.8.2
TypeScript 4.1.2
ESLint 7.14.0
node 12.19.0

created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add modifier `unused`

Codecov Report

Merging #2810 (9ab6259) into master (fb254a1) will increase coverage by 0.02%. The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master    #2810      +/-   ##
==========================================
+ Coverage   92.71%   92.74%   +0.02%     
==========================================
  Files         301      301              
  Lines       10191    10232      +41     
  Branches     2889     2902      +13     
==========================================
+ Hits         9449     9490      +41     
+ Misses        345      344       -1     
- Partials      397      398       +1     
Flag Coverage Δ
unittest 92.74% <95.23%> (+0.02%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...kages/eslint-plugin/src/rules/naming-convention.ts 88.91% <95.23%> (+0.47%) :arrow_up:
...ackages/scope-manager/src/referencer/Referencer.ts 94.87% <0.00%> (+0.84%) :arrow_up:
bradzacher

comment created time in 3 days

issue commenttypescript-eslint/typescript-eslint

[prefer-const] False positives when using non-nullish assertion operator

Alright, sorry for the trouble. 😅

almeidx

comment created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add modifier `unused`

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on <a href="https://opencollective.com/typescript-eslint" target="_blank" rel="noopener nofollow">https://opencollective.com/typescript-eslint</a>. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

bradzacher

comment created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

fix(scope-manager): fix assertion assignments not being marked as write references

Codecov Report

Merging #2809 (98dae55) into master (665b6d4) will decrease coverage by 0.04%. The diff coverage is 82.66%.

@@            Coverage Diff             @@
##           master    #2809      +/-   ##
==========================================
- Coverage   92.78%   92.74%   -0.05%     
==========================================
  Files         301      301              
  Lines       10159    10196      +37     
  Branches     2870     2890      +20     
==========================================
+ Hits         9426     9456      +30     
+ Misses        345      343       -2     
- Partials      388      397       +9     
Flag Coverage Δ
unittest 92.74% <82.66%> (-0.05%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...kages/eslint-plugin/src/rules/naming-convention.ts 88.43% <82.08%> (-1.39%) :arrow_down:
...ackages/scope-manager/src/referencer/Referencer.ts 94.87% <87.50%> (+0.84%) :arrow_up:
bradzacher

comment created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

fix(scope-manager): fix assertion assignments not being marked as write references

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on <a href="https://opencollective.com/typescript-eslint" target="_blank" rel="noopener nofollow">https://opencollective.com/typescript-eslint</a>. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

bradzacher

comment created time in 3 days

pull request commenttypescript-eslint/typescript-eslint

feat(eslint-plugin): [naming-convention] add modifiers `exported`, `global`, and `destructured`

Codecov Report

Merging #2808 (d6a08d4) into master (a8227a6) will decrease coverage by 0.04%. The diff coverage is 85.85%.

@@            Coverage Diff             @@
##           master    #2808      +/-   ##
==========================================
- Coverage   92.76%   92.71%   -0.05%     
==========================================
  Files         301      301              
  Lines       10150    10191      +41     
  Branches     2870     2889      +19     
==========================================
+ Hits         9416     9449      +33     
  Misses        345      345              
- Partials      389      397       +8     
Flag Coverage Δ
unittest 92.71% <85.85%> (-0.05%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...kages/eslint-plugin/src/rules/naming-convention.ts 88.43% <85.85%> (-0.88%) :arrow_down:
bradzacher

comment created time in 3 days

more