eslint-plugin-sequence v1.1.1
eslint-plugin-sequence
A collection of EsLint rules variously related to sequences: sequences of imports, import members, characters, and other elements.
Import rules can be used on ES6+ imports, as well as TypeScript imports
ordered-imports-by-path
(fixable): sort import statements by path
ordered-import-members
(fixable): sort imported members by name
strict-camel-case
(fixable via suggestions): enforce StrictCamelCase style in identifiers, forbid LOOSECamelCase
logical-expression-complexity
(not fixable): enforce limits on complexity of logical expressions
ordered-destructuring
(fixable): sort keys in object destructuring statements
Installation
npm install --save-dev eslint-plugin-sequenceConfigure with EsLint, e.g. in eslint.config.mjs
import sequence from "eslint-plugin-sequence";
...
plugins: [
sequence
],
rules: {
"sequence/ordered-imports-by-path": [
"error", {
ignoreCase: true,
sortSideEffectsFirst: true,
allowSeparateGroups: true,
sortTypeImportsFirst: true
}
],
"sequence/ordered-import-members": [
"error", {
ignoreCase: true,
sortSpecifiersWithComments: true
}
],
"sequence/strict-camel-case": [
"error", {
ignoreImports: false,
ignoredIdentifiers: ["legacyAPI", "htmlToXML", "PI", "TAU", "EPSILON"],
allowOneCharWords: "last",
ignoreSingleWordsIn: ["enum_member", "static_class_field"]
}
],
"sequence/logical-expression-complexity": [
"error", {
maxHeight: 3,
maxTerms: 6,
binaryOperators: ["==", "===", "!=", "!=="],
includeTernary: true
}
],
"sequence/ordererd-destructuring": [
"error", {
ignoreCase: true,
natural: true
}
],
...Compatibility
As of version 1.0.0, the plugin requires eslint peer 9.x. To use with older versions of eslint, use version 0.7.0.
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago