1.0.101 • Published 8 months ago

eslint-plugin-crisp v1.0.101

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

ESLint Plugin Crisp

Build and Release NPM Downloads

A set of custom ESLint configurations and rules for Crisp.

😘 Maintainers: @baptistejamin, @eliottvincent

Usage

The plugin provides two configurations:

  • crisp/recommended: JS rules targetting backend code (Node.js)
  • crisp/recommended-vue: JS rules targetting frontend code (Vue.js)

Add the plugin in your ESLint config object, then extend the desired configuration:

{
  "plugins": [
    "eslint-plugin-crisp"
  ],

  "extends": [
    "plugin:crisp/recommended"
    // OR "plugin:crisp/recommended-vue"
  ]
}

Documentation

This is the list of plugins and rules used by ESLint Plugin Crisp, and what they do.

Each item has emojis denoting:

  • 🟠: enabled in plugin:crisp/recommended
  • 🟢: enabled in plugin:crisp/recommended-vue

Configurations

NameDescription🟠🟢
eslint:recommendedCore ESLint rules🟢
plugin:jsdoc/recommendedJSDoc linting rules🟠🟢
plugin:vue/vue3-recommendedVue.js 3 linting rules🟢
plugin:vue-pug/vue3-recommendedPug templates support for Vue.js linting rules🟢

Plugins

NameDescription🟠🟢
eslint-plugin-jsdocJSDoc linting rules for ESLint🟠🟢

Rules

General JS rules

NameDescription🟠🟢
arrow-parensRequires parentheses around arrow function arguments🟠🟢
brace-styleEnforces one true brace style for blocks🟠🟢
comma-dangleDisallows trailing commas🟠🟢
comma-spacingEnforces consistent spacing before and after commas🟢
comma-styleRequires a comma after and on the same line🟠🟢
curlyEnsures block statements are always wrapped in curly braces🟠🟢
computed-property-spacingDisallows spaces inside computed property brackets🟢
default-param-lastEnforces default parameters to be last🟠🟢
default-case-lastEnforces default clauses in switch statements to be last🟠🟢
dot-notationEnforces dot notation instead of square-bracket notation🟠🟢
eqeqeqRequires the use of === and !==🟠🟢
eol-lastRequires newline at the end of files🟠🟢
indentEnforces 2-space indentation, and specific indentation levels for some nodes🟠🟢
for-directionPrevents for-loops to have stop condition that can never be reached🟠🟢
key-spacingEnforces consistent spacing in object literal properties (no space between the key and the colon, one space between the colon and the value)🟢
keyword-spacingEnforces consistent spacing before and after keywords🟠🟢
linebreak-styleEnforces Unix-style line endings🟠🟢
max-lenEnforces a maximum line length of 80 characters🟠
newline-per-chained-callRequires a newline after each call in a method chain🟢
no-consoleDisallows the use of console🟠🟢
no-debuggerDisallows the use of debugger🟠🟢
no-evalDisallows the use of eval🟠🟢
no-magic-numbersDisallows magic numbers (except the ones in the context of array indexes and in default value assignments)🟠
no-multi-strDisallows multiline strings🟠🟢
no-multiple-empty-linesAllows a maximum of 1 consecutive empty lines🟢
no-mixed-spaces-and-tabsDisallows mixed spaces and tabs for indentation🟠🟢
no-restricted-syntaxEnforces switch case's content to be enclosed in braces🟢
no-tabsDisallows tabs🟠🟢
no-trailing-spacesDisallows trailing whitespace at the end of lines🟠🟢
no-undefDisallows use of undeclared variables🟠🟢
no-unused-varsDisallows unused variables🟠🟢
no-unsafe-optional-chainingDisallows use of optional chaining in contexts where the undefined value is not allowed🟠🟢
object-curly-newlineRequires line breaks after opening and before closing braces🟠🟢
object-curly-spacingRequires spacing inside of braces🟠🟢
padded-blocksDisallows empty lines at the beginning and ending of blocks🟠🟢
padding-line-between-statementsRequires padding lines between various statements🟠🟢
prefer-arrow-callbackRequires using arrow functions for callbacks🟢
quotesEnforces the consistent use of double quotes (while allowing single quotes in order to avoid escape, and backticks for template literals)🟠🟢
quote-propsDisallows quotes around object literal property names that are not strictly required🟠🟢
semiRequires semicolons at the end of statements🟠🟢
semi-styleEnforces that semicolons are at the end of statements🟠🟢
semi-spacingDisallows space before semicolons, enforces spaces after🟢
space-before-blocksEnforces consistent spacing before blocks🟠🟢
space-in-parensEnforces zero spaces inside of parentheses🟠🟢
space-infix-opsEnforces spaces around infix operators🟢

Crisp JS rules

NameDescription🟠🟢
crisp/align-commentsEnforces alignment of comments compared to the previous line (the indent rule doesn't check this case)🟠🟢
crisp/align-consecutive-class-assignementsEnforces alignment of consecutive assignment statements in a class constructor🟠
crisp/align-one-varEnforces alignment of variables in 'one-var' statements🟠
crisp/align-requiresEnforces alignment of require statements🟠
crisp/constEnforces that const variables start with __ or are all uppercase🟠
crisp/constructor-variablesEnsures all class properties in the constructor start with _🟠
crisp/enforce-optionalEnforces use of optional chaining🟠🟢
crisp/header-checkEnforces files to start with Crisp header🟠🟢
crisp/header-comments-checkEnforces different comment blocks before different groups (imports, constants, instances and exports)🟠🟢
crisp/import-group-commentEnsures import statements are preceded by a comment stating their type🟢
crisp/import-group-orderEnsures import statements are correctly ordered🟢
crisp/methods-namingEnsures methods are named according to their access (public, private, protected)🟠🟢
crisp/methods-orderingEnsures methods order according to their access: public then protected then private🟠🟢
crisp/multiline-comment-end-backslashEnforces multiline comments to end with a backslash🟠🟢
crisp/newline-after-switch-caseRequires newline between switch cases🟠🟢
crisp/no-asyncDisallows the use of async/syntax, in favor of Promise🟠🟢
crisp/no-short-parametersDisallow parameter names shorter than 3 characters🟠🟢
crisp/no-space-in-optional-argumentsDisallows space before or after = in optional parameters🟠
crisp/no-useless-template-literalsDisallows unnecessary use of template literals🟢
crisp/no-var-in-blocksDisallows var declarations inside function, method, or class block🟠🟢
crisp/one-space-after-operatorEnforces at least one space before and one space after = and : operators🟠🟢
crisp/regex-in-constructorEnsures regular expressions are defined in the class constructor🟠🟢
crisp/ternary-parenthesisEnforces parentheses around conditions with operators in ternary expressions🟠🟢
crisp/two-lines-between-class-membersRequires exactly two line breaks between class methods🟠
crisp/variable-namesRequires variables defined within a method to start with _🟠🟢

General JSDoc rules

NameDescription🟠🟢
jsdoc/no-undefined-typesRule is disabled to allow some undefined types🟠
jsdoc/require-descriptionRequires all functions to have a description in their JSDoc🟢
jsdoc/require-param-descriptionRule is disabled as we don't write any description for @param tags🟠🟢
jsdoc/require-jsdocEnforces JSDoc comments on functions and classes🟠🟢
jsdoc/sort-tagsEnforces specific order for tags🟠🟢

Crisp JSDoc rules

NameDescription🟠🟢
crisp/jsdoc-align-paramsEnforces various alignments🟠🟢
crisp/jsdoc-check-indentationEnforces consistent indentation🟠🟢
crisp/jsdoc-check-optional-paramsRequires optional parameters to be surrounded by brackets🟢
crisp/jsdoc-enforce-accessRequires one of @public, @private, or @protected for functions🟢
crisp/jsdoc-enforce-classdescEnsures JSDoc for class headers to include a non-empty @classdesc🟠🟢
crisp/jsdoc-require-description-uppercaseRequires descriptions to start with an uppercase character🟠🟢

General Vue rules

NameDescription🟠🟢
vue/attributes-orderEnforces order of attributes🟢
vue/block-langAllows script blocks to have no lang attribute🟢
vue/block-orderEnforces order of component top-level elements (template, then script, then style)🟢
vue/block-tag-newlineRequires one line break after opening and before closing block-level tags🟢
vue/comma-dangleDisallows trailing commas in <template>🟢
vue/component-api-styleEnforces Options API style🟢
vue/component-name-in-template-casingEnforces tag names to kebab case🟢
vue/component-options-name-casingEnforces component names in components options to pascal case🟢
vue/custom-event-name-casingEnforces custom event names to camel case🟢
vue/eqeqeqRequires the use of === and !== in <template>🟢
vue/html-comment-content-spacingRequires one space before and after HTML comment tags🟢
vue/html-quotesRule is disabled in order to allow backticks in HTML attributes🟢
vue/key-spacingEnforces consistent spacing in object literal properties in <template> (no space between the key and the colon, one space between the colon and the value)🟢
vue/match-component-import-nameRequires the registered component name to match the imported component name🟢
vue/max-lenEnforces a maximum line length of 80 characters (only for <script>)🟢
vue/new-line-between-multi-line-propertyRequires new lines between multi-line props🟢
vue/no-bare-strings-in-templateDisallows the use of bare strings in <template>🟢
vue/no-irregular-whitespaceDisallows irregular / invalid whitespaces🟢
vue/no-multiple-objects-in-classDisallows to pass multiple objects into array to class HTML property🟢
vue/no-mutating-propsDisallows mutation of component props (except shallow mutation)🟢
vue/no-static-inline-stylesDisallows static inline style attributes🟢
vue/no-use-v-else-with-v-forDisallows using v-else-if/v-else on the same element as v-for (works but confusing)🟢
vue/no-useless-v-bindDisallows unnecessary v-bind directives🟢
vue/no-v-htmlRule is disabled in order to allow the use of v-html🟢
vue/padding-line-between-blocksRequires padding lines between blocks🟢
vue/padding-lines-in-component-definitionRequires padding lines in component definition🟢
vue/prefer-true-attribute-shorthandRequires shorthand form attribute when v-bind value is true🟢
vue/require-direct-exportRequires the component to be directly exported🟢
vue/v-for-delimiter-styleEnforces the use of in delimiter in v-for directive🟢
vue/v-slot-styleDisallows v-slot shorthand style🟢

Crisp Vue rules

NameDescription🟠🟢
crisp/vue-attribute-commaDisallows trailing comma after attribute🟢
crisp/vue-attribute-linebreakEnforces linebreak before first attribute and after last attribute🟢
crisp/vue-computed-orderEnsures computed properties are alphabetically ordered🟢
crisp/vue-emits-orderEnsures emits properties are alphabetically ordered🟢
crisp/vue-header-checkEnsures script, template and style tags start with corresponding comment block🟢
crisp/vue-html-indentEnforces consistent indentation in template (supports for Pug)🟢
crisp/vue-html-quotesEnforces HTML attributes to be enclosed with double quotes🟢
crisp/vue-no-regex-dataDisallows regular expressions to be declared in Vue data object🟢
crisp/vue-props-declaration-line-breakEnforces line break between type and default function in prop definition🟢
crisp/vue-props-declaration-multilineEnforces props declarations to be multiline🟢
crisp/vue-props-declaration-orderEnsures props declarations are alphabetically ordered🟢
crisp/vue-ref-caseEnforces ref attributes to snake case🟢

License

eslint-plugin-crisp is released under the MIT License. See the bundled LICENSE file for details.

1.0.101

8 months ago

1.0.100

8 months ago

1.0.99

8 months ago

1.0.98

8 months ago

1.0.97

9 months ago

1.0.96

9 months ago

1.0.95

11 months ago

1.0.94

11 months ago

1.0.93

12 months ago

1.0.84

1 year ago

1.0.83

1 year ago

1.0.82

1 year ago

1.0.88

1 year ago

1.0.87

1 year ago

1.0.86

1 year ago

1.0.85

1 year ago

1.0.89

1 year ago

1.0.91

1 year ago

1.0.90

1 year ago

1.0.92

1 year ago

1.0.81

1 year ago

1.0.79

1 year ago

1.0.78

1 year ago

1.0.80

1 year ago

1.0.77

1 year ago

1.0.76

2 years ago

1.0.75

2 years ago

1.0.74

2 years ago

1.0.73

2 years ago

1.0.72

2 years ago

1.0.71

2 years ago

1.0.70

2 years ago

1.0.69

2 years ago

1.0.68

2 years ago

1.0.67

2 years ago

1.0.66

2 years ago

1.0.65

2 years ago

1.0.62

2 years ago

1.0.61

2 years ago

1.0.60

2 years ago

1.0.64

2 years ago

1.0.63

2 years ago

1.0.53

2 years ago

1.0.59

2 years ago

1.0.58

2 years ago

1.0.57

2 years ago

1.0.44

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.49

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.52

2 years ago

1.0.43

2 years ago

1.0.41

2 years ago

1.0.42

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago