Skip to content

Configs: Also set parser: "@typescript-eslint/parser" in common configs? #8149

Closed as not planned
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Proposal Please Confirm You Have Done The Following...

Description

I, ah, never realized an ESLint config can also set a plugin! Or at least never thought to apply that feature to our configs. But that can be done, and is used in eslint-plugin-prettier.

Setting parser for users would remove a line from our getting started recommendation:

/* eslint-env node */
module.exports = {
  extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
-  parser: '@typescript-eslint/parser',
  plugins: ['@typescript-eslint'],
  root: true,
};

IMO reducing config properties from 4 to 3 would be a nice little win for users. The ESLint/TypeScript ecosystem already has a reputation for high complexity. Anything we can do to reduce that IMO is good marketing as well as a better user experience.

Plus, per #6814 -> #8146, the tooling has really solidified on it being unexpected to use any parser other than @typescript-eslint/parser.

Impacted Configurations

  • recommended
  • recommended-type-checked
  • strict
  • strict-type-checked
  • stylistic
  • stylistic-type-checked

Additional Info

Thanks @BPScott for informing me in https://github.com/JoshuaKGoldberg/dot-com/pull/140/files#r1435384958. 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeThis change will require a new major version to be releasedpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginpreset config changeProposal for an addition, removal, or general change to a preset configtriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions