- Changed from a "super plugin" to a flat config file
- Changed package name from
@cloudfour/eslint-plugin
to@cloudfour/eslint-config
- Update
eslint-plugin-jsdoc
fromv46
tov50
- Update
eslint-plugin-n
fromv16
tov17
- Update
eslint-plugin-promise
fromv6
tov7
- Update
eslint-plugin-unicorn
fromv48
tov56
- Update
typescript-eslint
fromv6
tov8
-
#551
f11e794
Thanks @calebeby! - Improve linting oftype
modifiers on imports.Reconfigured Rules (
recommended
Config)@cloudfour/import/no-duplicates
- "error" + [ + "error", + { + "prefer-inline": true + } + ]
Newly Enabled Rules (
recommended
Config » TS Overrides)
- #551
f11e794
Thanks @calebeby! - Re-exportdisable-type-checked
config from@typescript-eslint/eslint-plugin
-
#487
88ffd72
Thanks @renovate! - Updateeslint-plugin-unicorn
fromv43
tov47
New Rules
@cloudfour/unicorn/no-negated-condition
@cloudfour/unicorn/no-typeof-undefined
@cloudfour/unicorn/no-unnecessary-await
@cloudfour/unicorn/prefer-set-size
@cloudfour/unicorn/switch-case-braces
@cloudfour/unicorn/prefer-blob-reading-methods
Newly Enabled Rules
@cloudfour/unicorn/no-negated-condition
@cloudfour/unicorn/no-typeof-undefined
@cloudfour/unicorn/no-unnecessary-await
@cloudfour/unicorn/prefer-set-size
@cloudfour/unicorn/switch-case-braces
@cloudfour/unicorn/prefer-blob-reading-methods
@cloudfour/unicorn/prefer-event-target
Newly Disabled Rules
-
#497
2b0364a
Thanks @renovate! - Updateeslint-plugin-jsdoc
fromv39
tov46
Reconfigured Rules
The
@cloudfour/jsdoc/tag-lines
rule is now configured to enforce one blank line in JSDoc comments between the description of a function and the@param
/other tags.For example, the blank line after the description is enforced here:
/** * This is the description for the function, the blank line below this is enforced * * @param {string} name A parameter called name */ function someFunction(name) {}
New Rules
@cloudfour/jsdoc/informative-docs
@cloudfour/jsdoc/no-blank-block-descriptions
@cloudfour/jsdoc/no-blank-blocks
Deleted Rules
Newly Enabled Rules
-
#498
ee07640
Thanks @calebeby! - Drop support for Node 14 (now only node 16+ is supported)
- #396
eaa4ea8
Thanks @Paul-Hebert! - Revert changes tono-use-before-define
rule since it was more heavy-handed than expected.
- #392
a7d5860
Thanks @Paul-Hebert! - Disallow the use of variables before they are defined. This rule was previously enabled forlet
andconst
declarations, and now it is also enabled forfunction
s,class
es, andvar
s.
-
#395
ec2c2f3
Thanks @renovate! - Update eslint-plugin-unicorn to v43New Rules
Newly Enabled Rules
@cloudfour/unicorn/prefer-event-target
@cloudfour/unicorn/prefer-logical-operator-over-ternary
@cloudfour/unicorn/prefer-top-level-await
Also, the
prefer-node-protocol
rule has been updated to always apply torequire()
statements.
-
46db2ec
Thanks @calebeby! - Pin eslint-plugin-n to 15.2.115.2.2 has a regression and inserts the wrong file extensions.
-
#380
80af81b
Thanks @calebeby! - Enabled@cloudfour/n/file-extension-in-import
.❌
require('./foo')
→ ✅require('./foo.js')
❌import * as foo from './foo'
→ ✅import * as foo from './foo.js'
If the file that you are importing is a
.ts
file, you must import it as.js
, because of a decision that the TypeScript team made.It is auto-fixable.
-
#378
4545d67
Thanks @calebeby! - Enforce using thenode:
protocol for imports to node built-in modules (prefer-node-protocol
).❌
require('fs')
→ ✅require('node:fs')
❌import * as fs from 'fs'
→ ✅import * as fs from 'node:fs'
The
import
form is supported in node v14.13.1+. Therequire
form is supported in node v14.18.0+.It is auto-fixable.
-
#381
bee6a36
Thanks @calebeby! - Sort importsNewly Enabled Rules
These rules sort imports into separate categories, with empty lines between the categories, and with the imports within a category sorted alphabetically. The variable bindings within an import statement are also sorted alphabetically.
These rules are auto-fixable, however in some cases manual sorting may be needed. Occasionally, the auto-fix will detach comments from the import statements they refer to.
-
#364
20c9859
Thanks @renovate! - Update dependencyeslint-plugin-unicorn
tov42
New Rules
@cloudfour/unicorn/no-unreadable-iife
@cloudfour/unicorn/no-useless-switch-case
@cloudfour/unicorn/prefer-modern-math-apis
@cloudfour/unicorn/prefer-native-coercion-functions
Newly Enabled Rules
@cloudfour/unicorn/no-unreadable-iife
@cloudfour/unicorn/no-useless-switch-case
@cloudfour/unicorn/prefer-modern-math-apis
@cloudfour/unicorn/prefer-native-coercion-functions
Reconfigured Rules
@cloudfour/unicorn/template-indent
- "warn" + "error"
-
#366
d156896
Thanks @renovate! - Update dependencyeslint-plugin-jsdoc
tov39
No new rules, but there are some parsing and rule enforcement changes.
Node 12 is no longer supported
Node 18 is supported
-
#293
c24a70e
Thanks @renovate! - Updateeslint-plugin-unicorn
tov35
New Rules
@cloudfour/unicorn/no-useless-length-check
@cloudfour/unicorn/no-useless-spread
@cloudfour/unicorn/prefer-object-from-entries
Newly Enabled Rules
-
#306
62e271d
Thanks @renovate! - Updateeslint-plugin-unicorn
to v37New Rules (all are enabled by default)
-
#339
ce3d6ab
Thanks @renovate! - Updateeslint-plugin-unicorn
tov41
New Rules
@cloudfour/unicorn/no-await-expression-member
@cloudfour/unicorn/no-empty-file
@cloudfour/unicorn/no-thenable
@cloudfour/unicorn/no-useless-promise-resolve-reject
@cloudfour/unicorn/prefer-code-point
@cloudfour/unicorn/prefer-export-from
@cloudfour/unicorn/prefer-json-parse-buffer
@cloudfour/unicorn/relative-url-style
@cloudfour/unicorn/text-encoding-identifier-case
Newly Enabled Rules
@cloudfour/unicorn/no-await-expression-member
@cloudfour/unicorn/no-empty-file
@cloudfour/unicorn/no-thenable
@cloudfour/unicorn/no-useless-promise-resolve-reject
@cloudfour/unicorn/prefer-code-point
@cloudfour/unicorn/prefer-export-from
@cloudfour/unicorn/relative-url-style
@cloudfour/unicorn/text-encoding-identifier-case
Newly Disabled Rules
- #344
db15314
Thanks @calebeby! - Require eslint^8.0.0
. Migration guide for eslint v8.
-
#307
739814c
Thanks @renovate! - Updates thetypescript-eslint
packages to 5.0.0.Newly Enabled Rules
@cloudfour/typescript-eslint/no-confusing-void-expression
@cloudfour/typescript-eslint/no-meaningless-void-operator
@cloudfour/typescript-eslint/no-unnecessary-type-constraint
New Rules (not enabled by default)
@cloudfour/typescript-eslint/comma-dangle
@cloudfour/typescript-eslint/consistent-indexed-object-style
@cloudfour/typescript-eslint/no-confusing-void-expression
@cloudfour/typescript-eslint/no-duplicate-imports
@cloudfour/typescript-eslint/no-loop-func
@cloudfour/typescript-eslint/no-meaningless-void-operator
@cloudfour/typescript-eslint/no-non-null-asserted-nullish-coalescing
@cloudfour/typescript-eslint/no-restricted-imports
@cloudfour/typescript-eslint/no-unnecessary-type-constraint
@cloudfour/typescript-eslint/no-unsafe-argument
@cloudfour/typescript-eslint/non-nullable-type-assertion-style
@cloudfour/typescript-eslint/object-curly-spacing
@cloudfour/typescript-eslint/padding-line-between-statements
@cloudfour/typescript-eslint/prefer-return-this-type
@cloudfour/typescript-eslint/sort-type-union-intersection-members
@cloudfour/typescript-eslint/space-infix-ops
Deleted Rules
-
#290
eb96b8c
Thanks @renovate! - Updateeslint-plugin-jsdoc
tov36
New Rules
@cloudfour/jsdoc/match-name
(not enabled by default)
-
#252
f88d3f6
Thanks @renovate! - Updateeslint-config-xo
tov0.36.0
- Add more deprecated Node.js modules to
no-restricted-imports
- Remove unnecessary
no-restricted-syntax
rule - Enable
prefer-arrow-callback
- Enable
prefer-numeric-literals
- Add more deprecated Node.js modules to
-
#279
4728476
Thanks @renovate! - Updateeslint-plugin-unicorn
tov34
New Rules
@cloudfour/unicorn/no-array-method-this-argument
@cloudfour/unicorn/prefer-at
@cloudfour/unicorn/prefer-object-has-own
@cloudfour/unicorn/prefer-prototype-methods
@cloudfour/unicorn/prefer-top-level-await
@cloudfour/unicorn/require-array-join-separator
@cloudfour/unicorn/require-number-to-fixed-digits-argument
@cloudfour/unicorn/require-post-message-target-origin
Newly Enabled Rules
-
#262
cd2038f
Thanks @renovate! - Updateeslint-plugin-unicorn
to v32- New rule:
@cloudfour/unicorn/no-document-cookie
(enabled by default) - Enable rule:
@cloudfour/unicorn/numeric-separators-style
- Enable rule:
@cloudfour/unicorn/prefer-array-flat
- Enable rule:
@cloudfour/unicorn/prefer-array-flat-map
- New rule:
-
#256
ad9f8bd
Thanks @renovate! - Updateeslint-plugin-unicorn
to v31- Enabled new rule
@cloudfour/unicorn/prefer-node-protocol
- Enabled new rule
-
#280
ed92e21
Thanks @calebeby! - Disablepadding-line-between-statements
We decided that since devs can use blank lines to create logical groupings in code, it is best not to have ESLint enforce adding newlines
-
#206
4e2b9fb
Thanks @spaceninja! - Update dependencyeslint-config-prettier
to v7- Changed: At least ESLint 7.0.0 is now required.
-
#176
404c42d
Thanks @renovate! - Updateeslint-plugin-unicorn
to23.0.0
- New rule:
unicorn/prefer-math-trunc
(enabled by default) - New rule:
unicorn/prefer-ternary
(enabled by default) - New rule:
numeric-separators-style
(not enabled by default yet)
- New rule:
-
#187
a1f68c2
Thanks @spaceninja! - Upgraded to v15 of eslint-config-standard, which adds several rules:- Require indentation for values of ternary expressions (indent)
- Enforce newlines between operands of ternary expressions if the expression spans multiple lines (multiline-ternary)
- Disallow loops with a body that allows only one iteration (no-unreachable-loop)
- Disallow useless backreferences in regular expressions (no-useless-backreference)
- Enforce default clauses in switch statements to be last (default-case-last)
- Disallow Number Literals That Lose Precision (no-loss-of-precision)
-
#242
58c7204
Thanks @renovate! - Updateeslint-plugin-unicorn
tov29
New rules:
@cloudfour/unicorn/no-array-for-each
@cloudfour/unicorn/no-array-push-push
@cloudfour/unicorn/no-this-assignment
@cloudfour/unicorn/no-lonely-if
@cloudfour/unicorn/empty-brace-spaces
(not enabled by default)@cloudfour/unicorn/prefer-date-now
@cloudfour/unicorn/no-new-array
@cloudfour/unicorn/prefer-array-index-of
@cloudfour/unicorn/prefer-regexp-test
@cloudfour/unicorn/consistent-destructuring
(not enabled by default)@cloudfour/unicorn/prefer-array-some
@cloudfour/unicorn/prefer-default-parameters
@cloudfour/unicorn/no-static-only-class
@cloudfour/unicorn/prefer-array-flat
(not enabled by default)
Disabled rules:
@cloudfour/unicorn/import-index
(due to Node ESM resolution implementation)
Rename rules:
@cloudfour/unicorn/no-fn-reference-in-iterator
→@cloudfour/unicorn/no-array-callback-reference
@cloudfour/unicorn/no-array-instanceof
→@cloudfour/unicorn/no-instanceof-array
@cloudfour/unicorn/no-reduce
→@cloudfour/unicorn/no-array-reduce
@cloudfour/unicorn/prefer-dataset
→@cloudfour/unicorn/prefer-dom-node-dataset
@cloudfour/unicorn/prefer-flat-map
→@cloudfour/unicorn/prefer-array-flat-map
@cloudfour/unicorn/prefer-replace-all
→@cloudfour/unicorn/prefer-string-replace-all
@cloudfour/unicorn/prefer-starts-ends-with
→@cloudfour/unicorn/prefer-string-starts-ends-with
@cloudfour/unicorn/prefer-text-content
→@cloudfour/unicorn/prefer-dom-node-text-content
@cloudfour/unicorn/prefer-trim-start-end
→@cloudfour/unicorn/prefer-string-trim-start-end
@cloudfour/unicorn/prefer-event-key
→@cloudfour/unicorn/prefer-keyboard-event-key
@cloudfour/unicorn/prefer-node-append
→@cloudfour/unicorn/prefer-dom-node-append
@cloudfour/unicorn/prefer-node-remove
→@cloudfour/unicorn/prefer-dom-node-remove
There were many improvements/changes to individual rules, listed here
-
#191
7f732b6
Thanks @renovate! - Updateeslint-config-standard
to16.0.1
- Remove
eslint-plugin-standard
since all of the rules from it now live in other plugins camelcase
rule now allows variables starting withUNSAFE_
(from react) and known globalsno-unused-vars
now ignores unused caught errors (unicorn/prefer-optional-catch-binding
handles this use case)prefer-regex-literals
: EnableddisallowRedundantWrapping
optionarray-callback-return
: ChangeallowImplicit
tofalse
.use-isnan
: ChangeenforceForIndexOf
totrue
.
- Remove
-
2d8f332
#171 Thanks @calebeby! - Add@cloudfour/prefer-early-return
rule (enabled by default)This rule suggests to change code like this:
function a() { if (_) { a(); b(); c(); } }
into:
function a() { if (!_) return; a(); b(); c(); }
-
f4e2715
#164 Thanks @renovate! - Updateeslint-plugin-unicorn
to v22The new
unicorn/import-style
rule is disabled by default, so this is not a breaking change.
-
43b7918
#155 Thanks @renovate! - Update typescript-eslint to v4- Require
@ts-expect-error
comments to have a description explaining why - New scope analyzer. This is mostly bugfixes, but it is possible that it could cause rules to (correctly) trigger on code that they didn't before.
- Enabled the new
@typescript-eslint/consistent-type-imports
rule, which will auto-fix type imports to use the newimport type
syntax - Enabled
@typescript-eslint/no-unnecessary-condition
and@typescript-eslint/no-unnecessary-boolean-literal-compare
. If either of these rules trigger on your code, then that means that either your types are incorrect (likely missing| null
or| undefined
), or the condition is not necessary (meaning it either always runs or never runs).
- Require
1c5f202
#160 Thanks @calebeby! - Disablenode/no-missing-*
rules for TS, so that it doesn't error for importing*.ts
files
-
5943663
#137 Thanks @calebeby! - Remove rule: @cloudfour/no-param-reassignThis change is breaking if you have
// eslint-disable-next-line @cloudfour/no-param-reassign
in your code, or if you are manually enabling/configuring this rule. In either case, the migration path is to remove the rule configuration -
3112bb7
#136 Thanks @calebeby! - Add support for linting TypeScript filesIf you have .ts or .tsx files, ESLint should automatically start linting them once you update.
If typescript-eslint is unable to automatically infer your
tsconfig.json
location, you may need to manually configure that
- Update dependency
eslint-plugin-unicorn
to v21
- Update dependency
eslint
to v7.5.0 - Update dependency
eslint-config-xo
to v0.32.1 - Update dependency
eslint-formatter-pretty
to v4 - Update dependency
eslint-plugin-jsdoc
to v30 - Update dependency
kleur
to v4.0.2 - Update
jest
monorepo to v26.1.0
- Updated
eslint-plugin-jsdoc
to v25
- Updated
jest
to v26.0.1 - Updated
eslint
to v7
- Updated
eslint-plugin-unicorn
to v19 - Add
eslint-plugin-jsdoc
v24 to lint JSDoc comments (#97)
- Updated
jest
to v25.4.0 - Updated
prettier
to v2.0.5 - Updated
eslint-config-prettier
to v6.11.0 - Add fixtures to make testing new releases more reliable (#91)
- Disabled a few unicorn v19 rules (#104)
- Updated
eslint-plugin-unicorn
to v18
- Updated
jest
to v25.2.4
Edit: @calebeby pointed out that this didn't need to be a major release because prettier is a devDependency, so it won't affect our users. Sorry for the false alarm!
- Updated
prettier
to v2
- Updated
eslint-config-prettier
to v6.10.1 - Updated
eslint-config-standard
to v14.1.1
- Updated
eslint-plugin-unicorn
to v17
- Updated
eslint-config-xo
to v0.29.1
- Updated
jest
to v25 - Updated
eslint-plugin-node
to v11 - Updated
eslint-plugin-unicorn
to v16
- Updated
eslint
to v6.8.0 - Updated
eslint-config-prettier
to v6.10.0
- Updated
eslint-plugin-unicorn
to v14
- Updated
eslint
to v6.7.2
- Updated
eslint
to v6.6.0 - Updated
eslint-plugin-unicorn
to v13 - Updated
eslint-config-prettier
to v6 - Updated
eslint-config-standard
to v14 - Updated
eslint-plugin-node
to v10
- Updated
eslint-config-xo
to v0.27.2 - Updated
prettier
to v1.19.1
- Updated
eslint-plugin-node
to v9 - Updated
eslint-config-prettier
to v5 - Updated
eslint-plugin-unicorn
to v9 - Enabled
no-unused-expressions
for ternaries and short-circuit (#18)
- Added itself as a
devDep
(#17) - Updated
prettier
to v1.18
- Update
package.json
files
to includesrc/rules/**/*.js
(#15)
- Added build process to snapshot config and reduce peerDependencies (#9)
- Changed package name from
@cloudfour/eslint-config
to@cloudfour/eslint-plugin
Instead of referencing this in your ESLint config as@cloudfour/eslint-config
, useplugin:@cloudfour/recommended
- Updated dependencies
- Enable more rules from C4 JS guide (#11)
- Enable
eslint-plugin-node
recommended
rules (#11) - Enable
eslint-plugin-unicorn
recommended
rules (#12)
- Initial release