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

[ENHANCEMENT] Use a flat ESLint config file in the app blueprint #10451

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bertdeblock
Copy link
Contributor

@bertdeblock bertdeblock commented Mar 21, 2024

First time constructing a flat config, so I probably missed or misconfigured some things.
Still need to test this across various projects.

TODO:

  • Ignore files and folders based on old .eslintignore file
  • Use browser globals probably
  • GJS / GTS by default
  • Update tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo, we should probably include gjs/gts support in here by default, since there is no cost to having config for gjs/gts if folks aren't using it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide a todo list for this? I know the recommended flat config of eslint-plugin-ember already brings in the correct parser, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to use recommended-gjs or recommended-gts when needed it seems?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and set the parser, per the readme here:
https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs

this'll actually solve a lot of problems folks have had with gjs/gts, because there are bugs when a parser is specified outside of overrides with the non-flat config

@bertdeblock bertdeblock changed the title [ENHANCEMENT] Use a flat ESLint config file [ENHANCEMENT] Use a flat ESLint config file in the app blueprint Mar 21, 2024
],
],
},
ecmaVersion: 'latest',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest should be the default when using a flat config, so this can go? Not sure, because this one is under parserOptions.

},
ecmaVersion: 'latest',
requireConfigFile: false,
sourceType: 'module',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module should be the default when using a flat config, so this can go? Not sure, because this one is under parserOptions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sourceType is determined by the package.json type field, so I think we still need this since we lie about what type of package our projects are (CJS)

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

Successfully merging this pull request may close these issues.

None yet

2 participants