Conversation
Copy the Neostandard eslint config from https://github.com/CheckerNetwork/node Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
- env - ignores Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
| export default neostandard({ | ||
| noStyle: true, // Disable style-related rules, we use Prettier | ||
| ts: true, | ||
| }) |
There was a problem hiding this comment.
I am not convinced that sharing a two-line configuration is worth the extra ceremony required. (This patch has +4,949 new lines.)
We will also need to remember to periodically publish new versions of this package in order to ship neostandard updates to our repositories.
@juliangruber WDYT?
There was a problem hiding this comment.
package-lock.json is adding 4,808 lines, so the actual meaningful content is "only" 141 lines. To share eslint.config.js containing six lines of code 🤔
There was a problem hiding this comment.
I don't see it this way, the PR is already there and the extra code is basic orchestration. There are many repositories where the extra code is so much more than the actual code. We might also develop the eslint config in the future, or perform tooling upgrades. We don't want to do this in every repo one by one.
There was a problem hiding this comment.
I do wonder though if there's a better way to share this config
There was a problem hiding this comment.
For one, can we share the eslint and prettier config from one repo? This way there's half the orchestration, and less updates. It gets closer to my desire of having just one package for all things listing & formatting.
There was a problem hiding this comment.
I was thinking about this quite a bit.
Neostandard is already the shared linter config that shields us from the details of eslint configuration. The two tweaks we need to make - enable ts and disable style - are kind of specific to each repository. I don't expect them to change unless we significantly rework our formatting & linting setup.
The situation with Prettier is more complex; we need our custom shared config. Prettier provides a neat solution for that:
{
"prettier": "@CheckerNetwork/prettier-config"
"devDependencies": {
"@CheckerNetwork/prettier-config": "^1.0.0",
"prettier": "^3.5.3"
}
}Is it worth innovating here? I am happy to follow the default Prettier approach.
For one, can we share the eslint and prettier config from one repo?
It's not the typical path supported by Prettier.
I see two potential options we can explore:
- In
package.json, add `"prettier": "@CheckerNetwork/lint-config/prettier" - if Prettier supports importing from package sub-paths - Use
.prettierrc.jsfile that re-exports only the Prettier part of the shared configuration
I am not convinced the benefit of having one repo combining eslint and Prettier config is worth deviating from the typical path, though. These two configurations are independent (as long as we keep eslint style-rules disabled).
There was a problem hiding this comment.
Got it, if that's not supported, let's not innovate. +1 to inlining the neostandard config, and using one repo for the prettier config
There was a problem hiding this comment.
I want to go the overall simplest path possible here
There was a problem hiding this comment.
Alleviating your concerns about PR size a bit, this file can be removed as we make this repo also depend on the shared prettier config
| export default neostandard({ | ||
| noStyle: true, // Disable style-related rules, we use Prettier | ||
| ts: true, | ||
| }) |
There was a problem hiding this comment.
I don't see it this way, the PR is already there and the extra code is basic orchestration. There are many repositories where the extra code is so much more than the actual code. We might also develop the eslint config in the future, or perform tooling upgrades. We don't want to do this in every repo one by one.
| @@ -1,2 +1,11 @@ | |||
| # eslint-config | |||
|
|
|||
| Shared configuration for ESLint based on Neostandard | |||
There was a problem hiding this comment.
This is missing docs for how to use this config, could you add that too?
| export default neostandard({ | ||
| noStyle: true, // Disable style-related rules, we use Prettier | ||
| ts: true, | ||
| }) |
There was a problem hiding this comment.
I do wonder though if there's a better way to share this config
| export default neostandard({ | ||
| noStyle: true, // Disable style-related rules, we use Prettier | ||
| ts: true, | ||
| }) |
There was a problem hiding this comment.
For one, can we share the eslint and prettier config from one repo? This way there's half the orchestration, and less updates. It gets closer to my desire of having just one package for all things listing & formatting.
Copy the Neostandard eslint config from https://github.com/CheckerNetwork/node
See CheckerNetwork/node#710