Skip to content
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

[Flat config] Cannot use browser or recommended #576

Open
boris-petrov opened this issue Nov 21, 2024 · 1 comment
Open

[Flat config] Cannot use browser or recommended #576

boris-petrov opened this issue Nov 21, 2024 · 1 comment
Assignees

Comments

@boris-petrov
Copy link
Contributor

Congrats on the new release with flat-config support!

Trying to use github.getFlatConfigs().browser leads to the following error though:

TypeError: context.getScope is not a function
Occurred while linting /home/boris/project/file.ts:61
Rule: "github/async-preventdefault"
    at CallExpression (/home/boris/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]_pya6p6ja3qpsrjsqqan2f6352q/node_modules/eslint-plugin-github/lib/rules/async-preventdefault.js:20:33)
    at ruleErrorHandler (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1098:48)
    at /home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:337:14)
    at runRules (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1142:40)
    at #flatVerifyWithoutProcessors (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1911:31)

While using github.getFlatConfigs().recommended leads to:

Error: Key "rules": Key "filenamesPlugin/match-regex":
        Value ["^[a-z0-9-]+(.[a-z0-9-]+)?$"] should NOT have more than 0 items.

    at RuleValidator.validate (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/rule-validator.js:170:27)
    at new Config (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/config.js:228:27)
    at [finalizeConfig] (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/config/flat-config-array.js:216:16)
    at FlatConfigArray.getConfigWithStatus (/home/boris/project/node_modules/.pnpm/@[email protected]/node_modules/@eslint/config-array/dist/cjs/index.cjs:1178:55)
    at FlatConfigArray.getConfig (/home/boris/project/node_modules/.pnpm/@[email protected]/node_modules/@eslint/config-array/dist/cjs/index.cjs:1196:15)
    at entryFilter (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint-helpers.js:282:40)
    at async NodeHfs.<anonymous> (file:///home/boris/project/node_modules/.pnpm/@[email protected]/node_modules/@humanfs/core/src/hfs.js:574:24)
    at async NodeHfs.<anonymous> (file:///home/boris/project/node_modules/.pnpm/@[email protected]/node_modules/@humanfs/core/src/hfs.js:604:6)
    at async NodeHfs.walk (file:///home/boris/project/node_modules/.pnpm/@[email protected]/node_modules/@humanfs/core/src/hfs.js:614:3)
    at async globSearch (/home/boris/project/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint-helpers.js:323:26)

...github.getFlatConfigs().typescript works fine.

@gracepark gracepark self-assigned this Nov 25, 2024
@gracepark
Copy link
Contributor

gracepark commented Nov 25, 2024

Hi @boris-petrov! Thank you for bringing this to my attention. I believe I've merged in a fix. Can you try out v5.1.2 and let me know if you run into the same issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants