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

fix broken rule, set Angular/Typescript as optionalPeerDeps #32

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

Fuzzball24816
Copy link
Contributor

No description provided.

- It generates broken code cf https://github.com/rdlabo-team/eslint-plugin-rules/issues/5
- It applies on irrelevant places cf <https://github.com/rdlabo-team/eslint-plugin-rules/issues/1#issuecomment-1980955010>
- It gets lost with access modifiers cf <https://github.com/rdlabo-team/eslint-plugin-rules/issues/4>
- It generates broken code cf <https://github.com/rdlabo-team/eslint-plugin-rules/issues/5>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were added by my local markdown linter. Looks like it's shorthand for a URL. https://www.markdownguide.org/basic-syntax/#urls-and-email-addresses
Github seems to render them correctly anyway, but it might as well be correct.

@@ -4,7 +4,7 @@
*/
'use strict';

const path = require('path');
const path = require('node:path');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New recommended way to refer to builtin node packages.

otherFeatureFolders[featureFolderImportedIndex]
)
otherFeatureFolders[featureFolderImportedIndex],
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added and ran prettier

@@ -5,6 +5,7 @@
*/
'use strict';

const ts = require('typescript');
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 missing import caused this rule to error if it were ever used.

@@ -12,13 +12,14 @@ module.exports = {
type: 'problem',
fixable: 'code',
schema: [],
messages: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -18,7 +18,8 @@
"devDependencies": {
"eslint": "8.56.0",
"eslint-plugin-eslint-plugin": "5.3.0",
"eslint-plugin-node": "11.1.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

eslint-plugin-node was abandoned as of 2020. mysticatea/eslint-plugin-node#300
eslint-plugin-n is the forked replacement.

@@ -39,7 +40,28 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-rxjs": ">= 5",
"eslint-plugin-rxjs-angular": ">= 2",
"eslint-plugin-simple-import-sort": ">= 12"
"eslint-plugin-simple-import-sort": ">= 12",
"typescript": ">= 4"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typescript is already included from typescript-eslint, and implicitly depended on. Added it implicitly here.

@@ -18,7 +18,8 @@
"devDependencies": {
"eslint": "8.56.0",
"eslint-plugin-eslint-plugin": "5.3.0",
"eslint-plugin-node": "11.1.0"
"eslint-plugin-n": "17.10.2",
"prettier": "3.3.3"
},
"engines": {
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 review came from noticing that a typescript only lib had angular in the node_modules. Since npm made peerDependencies always be installed, installing this plugin causes angular to be included as a transitive dependency through angular-eslint.

It also brings dozens of other packages besides. Setting optional to true in peerDependenciesMeta lets us restrict the version if the package is installed, without forcing it.

package.json Outdated Show resolved Hide resolved
lib/rules/no-spreading-accumulators.js Show resolved Hide resolved
@XavierDupessey XavierDupessey merged commit 2dd6556 into master Dec 18, 2024
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