This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 213
Cleanup monorepo linting configuration #758
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
11ab7ea
Remove React presets/rules from monorepo lint config
edmorley bae0170
Remove unnecessary monorepo linting rule overrides
edmorley acc4d72
Make monorepo linting file includes less fragile
edmorley 78900e4
Add eslint to monorepo root devDependencies
edmorley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
packages/**/node_modules/ | ||
# TODO: Fix lint errors in our tests and remove this line | ||
packages/**/test/ | ||
# The templates have any lint errors fixed during project creation, | ||
# since we don't know which ESLint preset the user will choose. | ||
packages/create-project/commands/init/templates/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ const { projects, packages, isYarn } = require('./utils'); | |
|
||
/* eslint-disable no-underscore-dangle */ | ||
module.exports = class Project extends Generator { | ||
_logo() { | ||
static _logo() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ++ |
||
return ` _ _ | ||
_ __ ___ _ _ | |_ _ __ (_) _ __ ___ | ||
| '_ \\ / _ \\| | | || __|| '__|| || '_ \\ / _ \\ | ||
|
@@ -101,7 +101,7 @@ module.exports = class Project extends Generator { | |
prompting() { | ||
const done = this.async(); | ||
|
||
this.log(chalk.cyan.bold(this._logo())); | ||
this.log(chalk.cyan.bold(Project._logo())); | ||
this.log(chalk.white.bold('Welcome to Neutrino! 👋')); | ||
this.log(chalk.cyan('To help you create your new project, I am going to ask you a few questions.\n')); | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with removing this if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah so when I looked into
comma-dangle
it was a bit confusing. Airbnb enables it as 'always', the eslint-config-prettier preset then turns it off entirely, and ordinarily the 'prettier/prettier' rule would then turn it back on as 'never' - but we're not using 'prettier/prettier' at the moment.So removing this line would make it
'comma-dangle': 'off'
. (Which may or may not be what you meant?) :-)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grr, I'm dumb. I guess I was trying to align with:
https://github.com/mozilla-frontend-infra/neutrino-preset-mozilla-frontend-infra/pull/16/files#diff-5c42a4edfb59f1918fbdad6b1fbd9ba2R57
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zooming out a bit, my thoughts are:
react/prefer-stateless-function
- the individual projects should make those choices IMO)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify on this part - I agree that for legacy projects some rules (eg
react/prop-types
orreact/require-default-props
) are too burdensome - however by hiding the setting of it to'off'
inneutrino-preset-mozilla-frontend-infra
, it means brand new projects (which have no reason to not do things right from the start) don't know to turn it on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points all around. Most of the rules in our preset are stylistic choices to improve readability/maintainability, prevent mutation bugs, or get in the way of doing FP.
Let's raise these as issue in that preset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw the AirBnB style guide are sometimes receptive to suggestions for rule changes. By filing issues against them and linking to those issues when making adjustments, it would (a) show that upstreaming has been attempted, (b) give breadcrumbs to follow for understanding why the deviation :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I should also try and document why we currently have those deviations in the interim. (Part of my master plan for our org styleguide, which I haven't done yet).