Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Feb 19, 2025

Fixes #


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation merged commit 464ece5 into mrgrain/chore/re-add-linter-rules Feb 19, 2025
5 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/chore/lint-repo-config branch February 19, 2025 11:50
Comment on lines -41 to -52
// Require all imported dependencies are actually declared in package.json
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [ // Only allow importing devDependencies from:
'**/build-tools/**', // --> Build tools
'**/test/**', // --> Unit tests
],
optionalDependencies: false, // Disallow importing optional dependencies (those shouldn't be in use in the project)
},
],

Copy link
Contributor Author

@mrgrain mrgrain Feb 19, 2025

Choose a reason for hiding this comment

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

Removed this in favor of the projen built-in rule, which is pretty much the same but allows for a dynamic configuration of the paths in devDependencies.

Copy link
Contributor Author

@mrgrain mrgrain Feb 19, 2025

Choose a reason for hiding this comment

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

Change here and in the other package lint configs are due to now using the projen built-in rule for import/no-extraneous-dependencies.

As you can see these are pretty much the same. The main difference is that we now allow imports of peerDependencies which seems acceptable if not desired.

Comment on lines +184 to +194
// Eslint for projen config
// @ts-ignore
repoProject.eslint = new pj.javascript.Eslint(repoProject, {
tsconfigPath: `./${repoProject.tsconfigDev.fileName}`,
dirs: [],
devdirs: ['projenrc', '.projenrc.ts'],
fileExtensions: ['.ts', '.tsx'],
lintProjenRc: false,
});

const repo = configureProject(repoProject);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only actual change in here: We are adding a custom eslint config for the repo root.

@mrgrain mrgrain restored the mrgrain/chore/lint-repo-config branch February 19, 2025 11:57
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 this pull request may close these issues.

2 participants