Found that eslint rules and prettier rules were configured inconsistently resulting in different rules being enforced unexpectedly in different packages.
Cleaning up the build configuration resulted in more files being covered (not just src but build scripts, infra, etc), generated files being correctly ignored, and moving the nimble-components linting from our slowest validation step (5m58s) to one of the fastest (1m29s). Now linting is consistently faster than testing.
Modified the eslint-config-nimble/javascript and eslint-config-nimble/typescript configurations to be generic rules on top of the NI style guide counterparts that can apply to every package within nimble. Provides a place for some of nimble monorepo's stricter rule configuration to be shared until upstreamed to the style guide.
Added eslint-config-nimble/components to encapsulate rules specifically used for FAST component dev.
Moved all storybook related eslint settings into that package
Also aligned on the following organization for eslint files:
Each package should have ideally a single top-level .eslintrc.js file configured as root: true
Some packages may have child .eslintrc.js files for typescript project settings, but generally all rules should be configured top-level
The top-level .eslintrc.js configs only extend rulesets for files matched in overrides sections; they do not extend other rule sets outside of overrides
Each top-level config defines an ignorePatterns specific to that package. They should all ignore node_modules and likely also ignore dist among others that are packages specific
Every JavaScript and TypeScript file should be linted, including config, build scripts, etc.
π§ͺ Testing
Ran locally and on CI. Also added back top level npm run test and npm run lint commands in case someone wants to run those individually instead of using validate which does both.
β Checklist
[x] I have updated the project documentation to reflect my changes or determined no changes are needed.
Pull Request
π€¨ Rationale
Found that eslint rules and prettier rules were configured inconsistently resulting in different rules being enforced unexpectedly in different packages.
Cleaning up the build configuration resulted in more files being covered (not just src but build scripts, infra, etc), generated files being correctly ignored, and moving the nimble-components linting from our slowest validation step (5m58s) to one of the fastest (1m29s). Now linting is consistently faster than testing.
π©βπ» Implementation
eslint-config-nimble/javascript
andeslint-config-nimble/typescript
configurations to be generic rules on top of the NI style guide counterparts that can apply to every package within nimble. Provides a place for some of nimble monorepo's stricter rule configuration to be shared until upstreamed to the style guide.eslint-config-nimble/components
to encapsulate rules specifically used for FAST component dev..eslintignore
files as they are deprecated)Also aligned on the following organization for eslint files:
.eslintrc.js
file configured asroot: true
.eslintrc.js
files for typescript project settings, but generally all rules should be configured top-level.eslintrc.js
configs only extend rulesets for files matched inoverrides
sections; they do not extend other rule sets outside ofoverrides
ignorePatterns
specific to that package. They should all ignorenode_modules
and likely also ignoredist
among others that are packages specificπ§ͺ Testing
Ran locally and on CI. Also added back top level
npm run test
andnpm run lint
commands in case someone wants to run those individually instead of using validate which does both.β Checklist