feat: apply stylistic recommended rules to examples #966
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.
Situation
Examples are currently stylistically linted according to @stylistic/eslint-plugin to lint styling in the repo according to the configuration in eslint.config.mjs which specifies:
The rules marked as Recommended in eslint-plugin/rules.md are not applied as a group.
Change
Apply rule configuration
stylistic.configs.recommended
Add the following rules for consistency with Cypress coding conventions:
'@stylistic/arrow-parens': ['error', 'always']
'@stylistic/space-before-function-paren': ['error', 'always']
Ignore also app/assets/js/todo/ as this is an imported third-party app
Use
npx eslint --fix
to auto-fix. These are white-space and quote usage changes.Manually map the auto-fix changes into the app.
Test
Execute the following and confirm that no errors are reported and no changes are suggested:
The following warning is a separate issue caused by transient dependencies including
typescript
and Cypress incorrectly assuming that this is a TypeScript project: