Highlights
There are several breaking changes in v8.0.0. We’ve created a migration guide to explain the breaking changes and describe how to upgrade. In addition, there are several new features:
- ESLint’s default parser and all core rules now fully support the following ES2022 syntax:
- Class public instance fields and private instance fields
- Class public static fields and private static fields
- Class private instance methods and accessors
- Class private static methods and accessors
- RegExp match indices
- Top-level
await
- Autofix can now remove unused disable directives when
--fix
and--report-unused-disable-directives
are used together. - The use of reserved words as identifiers in ES3 is now disallowed. This change only affects users with default parser configured with
{ "ecmaVersion": 3 }
in parser options. - The
class-methods-use-this
rule has a newenforceForClassFields
option. - The
max-classes-per-file
rule has a newignoreExpressions
option. - The
meta.docs.category
property has been removed from all core rules.
Breaking Changes
7cf96cf
Breaking: Disallow reserved words in ES3 (fixes #15017) (#15046) (Milos Djermanovic)305e14a
Breaking: remove meta.docs.category in core rules (fixes #13398) (#14594) (薛定谔的猫)24c9f2a
Breaking: Strict package exports (refs #13654) (#14706) (Nicholas C. Zakas)86d31a4
Breaking: disallow SourceCode#getComments() in RuleTester (refs #14744) (#14769) (Milos Djermanovic)1d2213d
Breaking: Fixable disable directives (fixes #11815) (#14617) (Josh Goldberg)4a7aab7
Breaking: requiremeta
for fixable rules (fixes #13349) (#14634) (Milos Djermanovic)d6a761f
Breaking: Requiremeta.hasSuggestions
for rules with suggestions (#14573) (Bryan Mishkin)6bd747b
Breaking: support new regex d flag (fixes #14640) (#14653) (Yosuke Ota)8b4f3ab
Breaking: fix comma-dangle schema (fixes #13739) (#14030) (Joakim Nilsson)b953a4e
Breaking: upgrade espree and support new class features (refs #14343) (#14591) (Toru Nagashima)8cce06c
Breaking: add some rules to eslint:recommended (refs #14673) (#14691) (薛定谔的猫)86bb63b
Breaking: Dropcodeframe
andtable
formatters (#14316) (Federico Brigante)f3cb320
Breaking: drop node v10/v13/v15 (fixes #14023) (#14592) (薛定谔的猫)
Enhancements
67c0074
Update: Suggest missing rule in flat config (fixes #14027) (#15074) (Nicholas C. Zakas)cf34e5c
Update: space-before-blocks ignore after switch colons (fixes #15082) (#15093) (Milos Djermanovic)14a4739
Update:no-new-func
rule catching eval case ofMemberExpression
(#14860) (Mojtaba Samimi)0a1a850
Update: includeruleId
in error logs (fixes #15037) (#15053) (Ari Perkkiö)88a3952
Update: support class fields in thecomplexity
rule (refs #14857) (#14957) (Milos Djermanovic)6d1ccb6
Update: enforceForClassFields in class-methods-use-this (refs #14857) (#15018) (YeonJuan)dd10937
Update: added ignoreExpressions option to max-classes-per-file (#15000) (Josh Goldberg)05ca24c
Update: Code path analysis for class fields (fixes #14343) (#14886) (Nicholas C. Zakas)44c6fc8
Update: support class fields in func-name-matching (refs #14857) (#14964) (Milos Djermanovic)3d7d5fb
Update: reporting loc fornever
option ineol-last
(refs #12334) (#14840) (Nitin Kumar)f110926
Update: fix no-unused-vars false negative with comma operator (#14928) (Sachin)26b0cd9
Update: fix no-unreachable logic for class fields (refs #14857) (#14920) (Milos Djermanovic)9052eee
Update: check class fields in no-extra-parens (refs #14857) (#14906) (Milos Djermanovic)
Bug Fixes
2174a6f
Fix: require-atomic-updates property assignment message (fixes #15076) (#15109) (Milos Djermanovic)c9efb5f
Fix: preserve formatting when rules are removed from disable directives (#15081) (Milos Djermanovic)9bd3d87
Fix: semicolon-less style in lines-between-class-members (refs #14857) (#15045) (Milos Djermanovic)f966fe6
Fix: Update semi for class-fields (refs #14857) (#14945) (Nicholas C. Zakas)e9764f3
Fix: no-undef-init should not apply to class fields (refs #14857) (#14994) (Milos Djermanovic)3409785
Fix: camelcase ignoreGlobals shouldn’t apply to undef vars (refs #14857) (#14966) (Milos Djermanovic)ee1b54f
Fix: keyword-spacing private name compat (refs #14857) (#14946) (Nicholas C. Zakas)af96584
Fix: handle computed class fields in operator-linebreak (refs #14857) (#14915) (Milos Djermanovic)a773b99
Fix: no-useless-computed-key edge cases with class fields (refs #14857) (#14903) (Milos Djermanovic)cbc43da
Fix: prefer-destructuring PrivateIdentifier false positive (refs #14857) (#14897) (Milos Djermanovic)ccb9a91
Fix: dot-notation false positive with private identifier (refs #14857) (#14898) (Milos Djermanovic)
Documentation
f885fe0
Docs: add note and example for extending the range of fix (refs #13706) (#13748) (Milos Djermanovic)3da1509
Docs: Add jsdoctype
annotation to sample rule (#15085) (Bryan Mishkin)68a49a9
Docs: Update Rollup Integrations (#15142) (xiaohai)d867f81
Docs: Remove a dot from curly link (#15128) (Mauro Murru)2d654f1
Docs: add example .eslintrc.json (#15087) (Nicolas Mattia)16034f0
Docs: fix fixable example (#15107) (QiChang Li)7f2346b
Docs: Update release blog post template (#15094) (Nicholas C. Zakas)a744dfa
Docs: Update CLA info (#15058) (Brian Warner)91e82f5
Docs: LintMessage.line and column are possibly undefined (#15032) (Brandon Mills)dd56631
Docs: remove duplicate code path analysis document (#15033) (Milos Djermanovic)8c61f5a
Docs: add info about non-capturing groups to prefer-named-capture-group (#15009) (Andrzej Wódkiewicz)4338b74
Docs: add no-dupe-class-members examples with class fields (refs #14857) (#15005) (Milos Djermanovic)88b4e3d
Docs: Make clear how rule options are overridden (fixes #14962) (#14976) (Jake Ob)4165c7f
Docs: Clarify Linter vs ESLint in node.js api docs (fixes #14953) (#14995) (Brian Bartels)80cfb8f
Docs: fix typo in migration guide (#14985) (Nitin Kumar)396a0e3
Docs: update ScopeManager with class fields (#14974) (Milos Djermanovic)6663e7a
Docs: removedocs
script (fixes #14288) (#14971) (Nitin Kumar)44f7de5
Docs: Update deprecated information (#14961) (TagawaHirotaka)a8bcef7
Docs: Add 2021 and 2022 to supported ECMAScript versions (#14952) (coderaiser)b301069
Docs: fix ‘When Not To Use’ in prefer-named-capture-group (refs #14959) (#14969) (Milos Djermanovic)e98f14d
Docs: Fix typo in no-implicit-globals.md (#14954) (jwbth)81c60f4
Docs: document ESLint api (#14934) (Sam Chen)28fe19c
Docs: Add v8.0.0 migration guide (fixes #14856) (#14884) (Nicholas C. Zakas)1f5d088
Docs: add an exampleObject.assign()
for rule no-import-assign (#14916) (薛定谔的猫)c4e5802
Docs: improve rule details forno-console
(fixes #14793) (#14901) (Nitin Kumar)5c3a470
Docs: add class fields in no-multi-assign documentation (refs #14857) (#14907) (Milos Djermanovic)d234d89
Docs: add class fields in func-names documentation (refs #14857) (#14908) (Milos Djermanovic)e037d61
Docs: Mention workaround for escaping the slash character in selectors (#14675) (Aria)81f03b6
Docs: Update license copyright (#14877) (Nicholas C. Zakas)
Dependency Upgrades
7d3f7f0
Upgrade: unfrozen @eslint/eslintrc (fixes #15036) (#15146) (Brandon Mills)9e5c2e8
Upgrade: @eslint/eslintrc@1.0.1 (#15047) (Milos Djermanovic)ec9db63
Upgrade: @eslint/eslintrc@1.0.0 (#14865) (Milos Djermanovic)62c6fe7
Upgrade: Debug 4.0.1 > 4.3.2 (#14892) (sandesh bafna)88db3f5
Upgrade:js-yaml
to v4 (#14890) (Bryan Mishkin)ae6072b
Upgrade:eslint-visitor-keys
to v3 (#14902) (Bryan Mishkin)e53d8cf
Upgrade:markdownlint
dev dependencies (#14883) (Bryan Mishkin)d66e941
Upgrade: @humanwhocodes/config-array to 0.6 (#14891) (Bryan Mishkin)
Build Related
71faa38
Build: changelog update for 8.0.0-rc.0 (ESLint Jenkins)d148ffd
Build: changelog update for 8.0.0-beta.2 (ESLint Jenkins)95cc61e
Build: changelog update for 8.0.0-beta.1 (ESLint Jenkins)c74fe08
Build: Force prerelease peer dep for Node 16 in CI (#14933) (Brandon Mills)027165c
Build: changelog update for 8.0.0-beta.0 (ESLint Jenkins)b8b2d55
Build: add codeql (#14729) (薛定谔的猫)
Chores
fabdf8a
Chore: Removetarget.all
fromMakefile.js
(#15088) (Hirotaka Tagawa / wafuwafu13)05d7140
Chore: document target global in Makefile.js (#15084) (Hirotaka Tagawa / wafuwafu13)47be800
Chore: test Property > .key with { a = 1 } pattern (fixes #14799) (#15072) (Milos Djermanovic)9fb0f70
Chore: fix bug report template (#15061) (Milos Djermanovic)f87e199
Chore: Cleanup issue templates (#15039) (Nicholas C. Zakas)921ba1e
Chore: fix failing cli test (#15041) (Milos Djermanovic)143a598
Chore: Switch issues to use forms (#15024) (Nicholas C. Zakas)b4232d4
Chore: Add test that deprecated rules display a deprecated notice (#14989) (TagawaHirotaka)db15183
Chore: Refactor comments of tests (#14956) (TagawaHirotaka)a79c9f3
Chore: Enforce jsdoc check-line-alignment never (#14955) (Brett Zamir)2d18db6
Chore: add test for mergingparserOptions
in Linter (#14948) (Milos Djermanovic)9a4ae3b
Chore: Apply comment require-description and check ClassDeclaration (#14949) (Brett Zamir)8344675
Chore: fix small typo (#14951) (Sosuke Suzuki)58840ac
Chore: Update jsdoc plugin and tweak rules in effect (#14814) (Brett Zamir)be334f9
Chore: Fix Makefile call to linter.getRules() (#14932) (Brandon Mills)0c86b68
Chore: Replace old syntax for Array flat/flatMap (#14614) (Stephen Wade)6a89f3f
Chore: ignoreyarn-error.log
and.pnpm-debug.log
(#14925) (Nitin Kumar)3b6cd89
Chore: Add rel/abs path tests inno-restricted-{imports/modules}
rules (#14910) (Bryan Mishkin)f984515
Chore: add assertions on reporting location insemi
(#14899) (Nitin Kumar)149230c
Chore: Specify Node 14.x for Verify Files CI job (#14896) (Milos Djermanovic)537cf6a
Chore: updateglob-parent
(fixes #14879)(#14887) (Nitin Kumar)f7b4a3f
Chore: update dev deps to latest (#14624) (薛定谔的猫)