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

Run linting on the generated project in CI // add a working eslintconfig #84

Merged
merged 8 commits into from
Sep 26, 2024

Conversation

NullVoxPopuli
Copy link
Collaborator

@NullVoxPopuli NullVoxPopuli commented Sep 25, 2024

Unblocks CI verifying that #83 is correct

  • Adds linting to the tests
  • Adds an eslint config
    • ESLint 9
    • Flat config (all ESLint 9 supports)
    • GJS support

@NullVoxPopuli
Copy link
Collaborator Author

This has revealed that the upstream blueprint's eslintconfig is invalid.

I will be updating that in this PR

@NullVoxPopuli NullVoxPopuli force-pushed the test-lints-in-the-generated-project branch from 5176adc to 9bca726 Compare September 25, 2024 19:04
@NullVoxPopuli NullVoxPopuli changed the title Run linting on the generated project in CI Run linting on the generated project in CI // add a working eslintconfig Sep 25, 2024
...ensureLatestDeps,
// Linting
'@babel/plugin-proposal-decorators',
].filter((depToRemove) => existingDeps.includes(depToRemove)),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because of this filter, there is no danger to accidentally specifying something that isn't present in the upstream blueprint.


...ensureLatestDeps,
// Linting
'@babel/plugin-proposal-decorators',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unlike upstream, we don't want this plugin because we're using decorator-transforms in our babel config.

@@ -124,5 +149,16 @@ module.exports = {
});

await this.updateDeps(options);

const lintFix = require('ember-cli/lib/utilities/lint-fix');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lint:fix wasn't running at all before and now it is (and is kinda required, since version drift could change how the output of files end up)

/**
* ESM node files
*/
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this section isn't present in the upstream blueprint, because we have a vite.config.mjs and now eslint.config.mjs

import emberParser from 'ember-eslint-parser';
import babelParser from '@babel/eslint-parser';

const esmParserOptions = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unlike the upstream blueprint, we have a babel config, so we don't need to specify one here

Copy link

@simonihmig simonihmig left a comment

Choose a reason for hiding this comment

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

LGTM!

Slightly off-topic, but do I recall correctly from yesterday's team meeting, that we have agreement to make this blueprint independent from the official one? I feel that layering approach is doing more harm here than good, with all those overriding, installing additional and deinstalling unwanted deps. That can get confusing to maintain and brittle, at least that has been my experience with similar blueprint approaches.

@NullVoxPopuli
Copy link
Collaborator Author

Yes! I agree -- to prove that point (because not everyone agreed), I'd like to get all the way to TS support, as in landing #80, and then separating the blueprints -- which, I suspect will make for a much less weird index.js!

@NullVoxPopuli NullVoxPopuli merged commit a2df465 into main Sep 26, 2024
2 checks passed
@NullVoxPopuli NullVoxPopuli deleted the test-lints-in-the-generated-project branch September 26, 2024 17:32
@github-actions github-actions bot mentioned this pull request Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants