-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add meta.defaultOptions (#17656)
* [Reference] feat: add meta.defaultOptions * Removed optionsRaw * computed-property-spacing: defaultOptions * fix: handle object type mismatches in merging * Validate arrays in flat-config-array * Fix rule defaultOptions typos * Put back getRuleOptions as before * Apply deep merging in config-validator and rule-validator * Converted remaining rules. Note: inline comments still need to have defaults applied. * Fixes around inline comments * Extract to a getRuleOptionsInline * nit: new extra line * Test fix: meta.defaultOptions in a comment * Refactor-level review feedback * Used a recommended rule in linter.js test * Added custom-rules.md docs * Update docs/src/extend/custom-rules.md Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com> * Clarified undefined point * Adjusted for edge cases per review * Refactored per review * Removed lint disable in source * Added Linter test for meta.defaultOptions * Documented useDefaults from Ajv * Set up meta+schema merging unit tests for flat (passing) and legacy (failing) * Potential solution: boolean applyDefaultOptions param for runRules * chore: node:assert * Update lib/shared/deep-merge-arrays.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Made tests more explicit on defaulting behavior * Handled defaultOptions and option-less inline comments * Added explicit tests for mismatched comment options and comment options with schema: false * Try out configToValidate approach * Add in unit tests Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Always apply defaultOptions, even with meta.schema: false * Filled in some falsy values * Fix a few lint complaints * That's right, Infinity is not allowed * Update lib/config/rule-validator.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/src/extend/custom-rules.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/src/extend/custom-rules.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Revert deprecated rules * Bring in eslintrc#factor-in-default-options * Add index.d.ts types * Update lib/linter/linter.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Apply suggestions from code review Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Moved config changing outside of validation * git checkout main -- lib/config/rule-validator.js * linter.js touchups and revert * Update lib/config/config.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update package.json --------- Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com> Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
- Loading branch information
1 parent
fd33f13
commit 2edc0e2
Showing
86 changed files
with
1,186 additions
and
548 deletions.
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
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
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
Oops, something went wrong.