eslint-plugin-sequence

0.5.7 • Public • Published

eslint-plugin-sequence

github actions npm npm downloads

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, forbid LOOSECamelCase

logical-expression-complexity

(not fixable): enforce limits on complexity of logical expressions

Installation

npm install --save-dev eslint-plugin-sequence

Configure with EsLint, e.g. in .eslintrc.json

...
"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", {
            "ignoreProperties": false,
            "ignoreImports": false,
            "ignoredIdentifiers": ["legacyAPI", "htmlToXML", "PI", "TAU", "EPSILON"],
            "allowOneCharWords": "last",
            "ignoreSingleWords": false,
            "ignoreSingleWordsIn": ["enum_member", "static_class_field"]
        }
    ],
    "sequence/logical-expression-complexity": [
        "error", {
            "maxHeight": 3,
            "maxTerms": 6,
            "binaryOperators": ["==", "===", "!=", "!=="],
            "includeTernary": true
        }
    ],
    ...
}
...

Package Sidebar

Install

npm i eslint-plugin-sequence

Weekly Downloads

0

Version

0.5.7

License

ISC

Unpacked Size

103 kB

Total Files

15

Last publish

Collaborators

  • adashrod