Skip to content

Update Eslint to v10 - #270

Open
Joma1890 wants to merge 40 commits into
cloudflightio:mainfrom
Joma1890:eslint-10-update
Open

Joma1890 wants to merge 40 commits into
cloudflightio:mainfrom
Joma1890:eslint-10-update

Conversation

@Joma1890

Copy link
Copy Markdown

No description provided.

* node 24 is the active lts, yarn 4.18
* packageManager for corepack and dependabot, they ignore the volta field
* jest 30 loads its ts config through node, so the root package is an es module now

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* snapshot of the applied rules per file type, fixtures for valid code, each rule layer and the format output, helpers in test/
* the custom rule test runs again, with @typescript-eslint/rule-tester
* TSESTREE_SINGLE_RUN=false, with CI=true typed linting breaks under jest otherwise

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* snapshot of the applied rules, valid and invalid components and html templates, one rule per layer
* a small @angular/core shim instead of the framework

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* snapshot of the applied rules, valid and invalid tsx files, one rule per layer and the format output
* a small react shim instead of the framework

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* snapshot of the applied rules, valid and invalid single-file components with a typed script

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* snapshot of the applied rules, valid and invalid files, a node rule and a type-aware one

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint's defineConfig and a typed eslint.config.ts reject typescript-eslint's config type ("Index signature for type 'string' is missing in type 'LanguageOptions'")
* the factories return Linter.Config[], the objects are the same, only the type changes

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* the built packages import tslib, @typescript-eslint/utils and typescript-eslint, until now they were only found through hoisting
* eslint as dev dependency in every package, for its own peer
* tilde ranges for the plugins that bring rules, a minor release can add rules to their presets

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* typescript 5.9.3 with matching node and estree typings
* importsNotUsedAsValues no longer exists, verbatimModuleSyntax stays off
* lint-staged 16.2.6

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* also reports target['onclick'], target[`onclick`], setAttribute('onclick', …) and window handlers like onmessage, but no longer a variable that is named like an event
* the meta claimed a fixer and described another rule, the docs url pointed to a file that does not exist
* the plugin version comes from package.json, the unused rule creators are gone

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* rule ids written out instead of template keys, 'error' instead of ['error']
* config modules, rule maps and plugin imports named the same way in every package
* fixed some rule comments, the resulting config does not change

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* cloudflightAngularFormatConfig is the typescript format config plus the fixable template rules
* the angular plugins are registered without rules, so their disable comments work in the format run and --fix keeps them

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint-plugin-security and eslint-plugin-no-unsanitized in every config, every rule listed so that a plugin update cannot add one
* xss sinks are errors, also react/no-danger and angular's bypassSecurityTrust methods, heuristics warnings, server-only checks off, eval only through no-eval
* the node config keeps its stricter severities and no longer registers the plugins itself

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* the base, security, import and format configs cover jsx and tsx themselves, the format config parses .tsx with jsx
* react no longer adds the base and import rules a second time or remaps the format config
* the import and disable-type-checked configs are internal now, base and security stay exported for the framework packages

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* vueTsEslintConfig is deprecated
* the helper looks for .vue files below rootDirectory, keeps the no-unsafe rules and shares our typescript-eslint plugin and parser
* .vue files are untyped unless our own check lists them as typescript SFCs, the helper's list missed lang='ts' and depended on the cwd

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* 8.56 is the first version with eslint 10 support
* tilde ranges, a minor release such as 8.71 adds rules to the strict preset
* import-x gets the path of our parser, by name it fails when npm or pnpm keep it below typescript-eslint; the import-x cast is not needed anymore (typescript-eslint/typescript-eslint#10395)

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* no-conflicting-lifecycle is gone, prefer-inject and template/prefer-control-flow are recommended now
* prefer-on-push-component-change-detection accepts components without changeDetection, OnPush is the default since angular 22
* node engines and an @angular/core peer from angular 22, the readme says the package requires angular 22 and typescript 6.0

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint-plugin-vue 10.10 has vue-eslint-parser as a peer, the vue package brings it now
* eslint-plugin-n 18 is esm only and needs node 20 or newer
* eslint-plugin-security 4 supports eslint 10, no-unsanitized 4.1.5

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* stylistic 5.10, perfectionist 5.11, import-x 4.17.1, typescript resolver 4.4.5
* the resolver is passed as an object, import-x did not find it by name when npm nested it below our package
* noWarnOnMultipleProjects, the default glob matches every tsconfig*.json on purpose

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint-plugin-react-hooks 7.1.1 for eslint 10, with its stable recommended preset instead of recommended-latest
* eslint-plugin-react and eslint-plugin-jsx-a11y have no eslint 10 release yet: pinned to 7.37.5 and 6.10.2, react's rules wrapped with fixupPluginRules (jsx-eslint/eslint-plugin-react#3977)
* the format config registers the react plugins, their disable comments failed the format run

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* json-es was not used
* eslint ships its own types, the private type packages use them too

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint 9 is end of life since 2026-08-06
* peer ^10.0.0 and node engines from eslint 10
* @eslint/js 10 and @eslint/compat 2

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* without tsConfigFiles each file uses its closest tsconfig.json, a ts file outside all of them is an error
* files below a nested tsconfig.json also resolve their imports through it, in the lint and in the format run
* tsConfigFiles keeps parserOptions.project, its paths are relative to rootDirectory for the import resolver too
* jest runs with one worker, the project service leaves a tsserver timer behind

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* js files are parsed without a tsconfig, the typed parser options only apply to ts files
* the core rules that typescript-eslint turns off are back for js, with node and browser globals
* .cjs files are commonjs: require is allowed and top-level names are no globals
* explicit-member-accessibility and n/no-sync are off for js

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* core rules with a typed replacement stay off in ts, js keeps the core versions including dot-notation and require-await
* the typed no-unused-expressions gets the options of the core rule
* no-duplicate-imports is off where import-x/no-duplicates runs, .vue files keep it

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* rules outside the recommended presets, for example no-uncalled-signals, computed-must-return and template/no-nested-tags
* from the style guide: class and style bindings (no-inline-styles allows the dynamic ones), output emitter refs, template complexity limits, template eqeqeq is on again, no class suffixes
* prefer-static-string-properties fixes itself and goes into the format config

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* typed linting uses the project's typescript
* >=5.0.0 <6.1.0, what typescript-eslint and eslint-plugin-n both support
* the readmes list the peer, angular itself needs 6.0.x

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* build, lint and test on all three, one failing platform does not cancel the others
* read-only token, a new push cancels the running checks, 20 minute timeout
* checkout v7 and volta-cli/action 5.0.0, 4.0.1 has no arm64 build for the macos runners

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* trailing comma in multiline enums, like in objects
* ? and : start the line in conditionals and conditional types

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint deprecated the core rule in favour of the stylistic one, the format run fixes it now
* the core rule stays in the lint config until eslint 11

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint, typescript-eslint and the plugins depend on each other and come in one pull request
* eslint-plugin-react and eslint-plugin-jsx-a11y stay separate, they need a manual check
* versioning-strategy increase, the updates also raise the tilde ranges

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* repository metadata in the published package.json files
* dist is deleted before the build, tsc left the output of renamed and deleted files behind
* packages are published in dependency order, the workflow builds, lints and tests first, with the actions of build.yml

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint-plugin-n chose module or script by the package.json of the cwd
* the package.json in rootDirectory decides now for .js and .ts files, the .js files of a commonjs package may use require
* .cjs and .cts are always commonjs, .mjs and .mts always modules

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* upgrade section in the root readme
* usage examples in our own code style, with import.meta.dirname
* the angular readme lists the rules the config adds to the presets

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* eslint/config exports includeIgnoreFile since 10.4, the readme examples and our own configs use it
* peer ^10.4.0 everywhere, @eslint/compat is only left in the react package for fixupPluginRules

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* decorated constructor parameters lost their indentation, indent ignored them
* import-x/order sorts the imports, an import that would have to move across a side-effect import is reported instead
* the upgrade section says how the reformat sorts imports

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
…config

* disable comments for @Stylistic and perfectionist rules failed the lint run, now it knows them and does not report them as unused, lint --fix would delete them
* cloudflightNodeFormatConfig registers eslint-plugin-n, its disable comments failed the format run
* custom configuration: projects register their own plugins in eslint.format.mjs too

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* non-nullable-type-assertion-style, its fix writes a ! that no-non-null-assertion forbids
* react/jsx-fragments, its fix wrote React.Fragment, which is not in scope with the automatic jsx runtime
* n/hashbang for typescript files, its fix deleted the shebang of a cli

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* the typescript options of the core rule, eslint 10.4 has them
* enum values, numeric literal types, readonly class properties and type indexes are no magic numbers

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
* indent skipped every jsx node, the ignore list came from the core rule
* the stylistic jsx rules for attributes, closing tags, curly braces and multiline wrapping, also after && and ?:
* the upgrade section says the reformat also formats jsx

Signed-off-by: Jonas Macho <jonas.macho@cloudflight.io>
@Joma1890
Joma1890 force-pushed the eslint-10-update branch 3 times, most recently from fa5e510 to b4022d1 Compare October 20, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant