1.1.1 • Published 11 months ago

eslint-plugin-sequence v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

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 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-sequence

Configure 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.

1.1.1

11 months ago

1.1.0

11 months ago

1.0.0

11 months ago

0.7.0

12 months ago

0.6.1

12 months ago

0.6.0

12 months ago

0.5.7

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.5.1

2 years ago

0.3.2

3 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago