-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [space-before-function-paren] incorrect handling of abstract methods #2275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…of abstract functions Fixes #2274
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 https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
Codecov Report
@@ Coverage Diff @@
## master #2275 +/- ##
=======================================
Coverage 93.10% 93.10%
=======================================
Files 283 283
Lines 9024 9024
Branches 2467 2467
=======================================
Hits 8402 8402
Misses 301 301
Partials 321 321
|
👋 this just hit us on the typescript codebase, I think I would have expected this to take the "@typescript-eslint/space-before-function-paren": ["error", {
"asyncArrow": "always",
"anonymous": "always",
"named": "never"
}], export abstract class RunnerBase {
// contains the tests to run
public tests: (string | FileBasedTest)[] = [];
/** Add a source file to the runner's list of tests that need to be initialized with initializeTests */
public addTest(fileName: string) {
this.tests.push(fileName);
}
public enumerateFiles(folder: string, regex?: RegExp, options?: { recursive: boolean }): string[] {
return ts.map(IO.listFiles(userSpecifiedRoot + folder, regex, { recursive: (options ? options.recursive : false) }), ts.normalizeSlashes);
}
abstract kind(): TestRunnerKind;
// ^
abstract enumerateTestFiles(): (string | FileBasedTest)[];
// ^
} Does that make sense? |
ja that's what this fix is doing. give the |
Cool, it doesn't look like it fixed it: $ npm install typescript-eslint@canary
❯ cat node_modules/@typescript-eslint/eslint-plugin/package.json | grep version
"version": "3.6.1-alpha.1"
[lint] same
{
code: 'abstract class Baz { constructor () {} abstract report(result: number, cwd: string): string | null; }',
options: [{ named: 'never' }],
}, It was the |
ced6591 - the tests are passing fine on the latest master and checking out locally for me they're passing fine as well. Dumping your example code + config into a test also passes fine against master for me: |
Hah, sorry for dragging you along there |
Fixes #2274