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

docs: update typescript-eslint suggestion? #404

Closed
braden-w opened this issue Jul 7, 2024 · 1 comment · Fixed by #418
Closed

docs: update typescript-eslint suggestion? #404

braden-w opened this issue Jul 7, 2024 · 1 comment · Fixed by #418

Comments

@braden-w
Copy link

braden-w commented Jul 7, 2024

According to the typescript-eslint v7 release notes, it seems that @typescript-eslint/parser is no longer recommended in flat configs, but rather just typescript-eslint.

Because this new package includes dependencies on our plugin and parser, you can replace those dependencies entirely:

pnpm remove @typescript-eslint/parser @typescript-eslint/eslint-plugin
pnpm add typescript-eslint

The simplest of this new tooling would be the following which will enable the ESLint recommended config and our recommended config (including turning on our plugin and parser):

// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
  eslint.configs.recommended,
  ...tseslint.configs.recommended,
);

Just wanted to double check if the installation instructions in the readme should be updated accordingly or not.

@Xifong
Copy link

Xifong commented Aug 2, 2024

Does that mean our config should look like the following?

import eslintPluginAstro from 'eslint-plugin-astro';
import tseslint from 'typescript-eslint';

export default [
  // add more generic rule sets here, such as:
  // js.configs.recommended,
  ...eslintPluginAstro.configs.recommended,
  ...tseslint.configs.recommended,
  {
    rules: {
      // override/add rules settings here, such as:
      // "astro/no-set-html-directive": "error"
    },
  },
];

That leads to a Class extends value undefined is not a constructor or null and I'm not sure what the config should actually look like to get a flat config for parsing typescript astro components working.

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

Successfully merging a pull request may close this issue.

2 participants