eslint-plugin-crisp

1.1.9 • Public • Published

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:

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

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

import crisp from "eslint-plugin-crisp";

export default defineConfig([
  crisp.configs["recommended"],
  // OR crisp.configs["recommended-vue"]

  {
    rules: {
      // Rules override
    }
  }
]);

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 recommended
  • 🟢: enabled in recommended-vue

Configurations

Name Description 🟠 🟢
@eslint/js:recommended Core ESLint rules 🟢
eslint-plugin-jsdoc:recommended JSDoc linting rules 🟠 🟢
eslint-plugin-vue:recommended Vue.js 3 linting rules 🟢
eslint-plugin-vue-pug:recommended Pug templates support for Vue.js linting rules 🟢

Plugins

Name Description 🟠 🟢
eslint-plugin-jsdoc JSDoc linting rules for ESLint 🟠 🟢

Rules

General JS rules

Name Description 🟠 🟢
arrow-parens Requires parentheses around arrow function arguments 🟠 🟢
brace-style Enforces one true brace style for blocks 🟠 🟢
comma-dangle Disallows trailing commas 🟠 🟢
comma-spacing Enforces consistent spacing before and after commas 🟢
comma-style Requires a comma after and on the same line 🟠 🟢
curly Ensures block statements are always wrapped in curly braces 🟠 🟢
computed-property-spacing Disallows spaces inside computed property brackets 🟢
default-param-last Enforces default parameters to be last 🟠 🟢
default-case-last Enforces default clauses in switch statements to be last 🟠 🟢
dot-notation Enforces dot notation instead of square-bracket notation 🟠 🟢
eqeqeq Requires the use of === and !== 🟠 🟢
eol-last Requires newline at the end of files 🟠 🟢
indent Enforces 2-space indentation, and specific indentation levels for some nodes 🟠 🟢
for-direction Prevents for-loops to have stop condition that can never be reached 🟠 🟢
key-spacing Enforces consistent spacing in object literal properties (no space between the key and the colon, one space between the colon and the value) 🟢
keyword-spacing Enforces consistent spacing before and after keywords 🟠 🟢
linebreak-style Enforces Unix-style line endings 🟠 🟢
max-len Enforces a maximum line length of 80 characters 🟠
newline-per-chained-call Requires a newline after each call in a method chain 🟢
no-console Disallows the use of console 🟠 🟢
no-debugger Disallows the use of debugger 🟠 🟢
no-eval Disallows the use of eval 🟠 🟢
no-implicit-coercion Disallows short notations for type conversion 🟢
no-magic-numbers Disallows magic numbers (except the ones in the context of array indexes and in default value assignments) 🟠
no-multi-str Disallows multiline strings 🟠 🟢
no-multiple-empty-lines Allows a maximum of 1 consecutive empty lines 🟢
no-mixed-spaces-and-tabs Disallows mixed spaces and tabs for indentation 🟠 🟢
no-restricted-syntax Enforces switch case's content to be enclosed in braces 🟢
no-tabs Disallows tabs 🟠 🟢
no-trailing-spaces Disallows trailing whitespace at the end of lines 🟠 🟢
no-undef Disallows use of undeclared variables 🟠 🟢
no-unused-vars Disallows unused variables 🟠 🟢
no-unsafe-optional-chaining Disallows use of optional chaining in contexts where the undefined value is not allowed 🟠 🟢
object-curly-newline Requires line breaks after opening and before closing braces 🟠 🟢
object-curly-spacing Requires spacing inside of braces 🟠 🟢
padded-blocks Disallows empty lines at the beginning and ending of blocks 🟠 🟢
padding-line-between-statements Requires padding lines between various statements 🟠 🟢
prefer-arrow-callback Requires using arrow functions for callbacks 🟢
quotes Enforces the consistent use of double quotes (while allowing single quotes in order to avoid escape, and backticks for template literals) 🟠 🟢
quote-props Disallows quotes around object literal property names that are not strictly required 🟠 🟢
semi Requires semicolons at the end of statements 🟠 🟢
semi-style Enforces that semicolons are at the end of statements 🟠 🟢
semi-spacing Disallows space before semicolons, enforces spaces after 🟢
space-before-blocks Enforces consistent spacing before blocks 🟠 🟢
space-in-parens Enforces zero spaces inside of parentheses 🟠 🟢
space-infix-ops Enforces spaces around infix operators 🟢

Crisp JS rules

Name Description 🟠 🟢
crisp/align-comments Enforces alignment of comments compared to the previous line (the indent rule doesn't check this case) 🟠 🟢
crisp/align-consecutive-class-assignements Enforces alignment of consecutive assignment statements in a class constructor 🟠
crisp/align-one-var Enforces alignment of variables in 'one-var' statements 🟠
crisp/align-requires Enforces alignment of require statements 🟠
crisp/const Enforces that const variables start with __ or are all uppercase 🟠
crisp/constructor-variables Ensures all class properties in the constructor start with _ 🟠
crisp/enforce-optional Enforces use of optional chaining 🟠 🟢
crisp/header-check Enforces files to start with Crisp header 🟠 🟢
crisp/header-comments-check Enforces different comment blocks before different groups (imports, constants, instances and exports) 🟠 🟢
crisp/import-group-comment Ensures import statements are preceded by a comment stating their type 🟢
crisp/import-group-order Ensures import statements are correctly ordered 🟢
crisp/methods-naming Ensures methods are named according to their access (public, private, protected) 🟠 🟢
crisp/methods-ordering Ensures methods order according to their access: public then protected then private 🟠 🟢
crisp/multiline-comment-end-backslash Enforces multiline comments to end with a backslash 🟠 🟢
crisp/newline-after-switch-case Requires newline between switch cases 🟠 🟢
crisp/no-async Disallows the use of async/syntax, in favor of Promise 🟠 🟢
crisp/no-short-parameters Disallow parameter names shorter than 3 characters 🟠 🟢
crisp/no-space-in-optional-arguments Disallows space before or after = in optional parameters 🟠
crisp/no-useless-template-literals Disallows unnecessary use of template literals 🟢
crisp/no-var-in-blocks Disallows var declarations inside function, method, or class block 🟠 🟢
crisp/one-space-after-operator Enforces at least one space before and one space after = and : operators 🟠 🟢
crisp/regex-in-constructor Ensures regular expressions are defined in the class constructor 🟠 🟢
crisp/ternary-parenthesis Enforces parentheses around conditions with operators in ternary expressions 🟠 🟢
crisp/two-lines-between-class-members Requires exactly two line breaks between class methods 🟠
crisp/variable-names Requires variables defined within a method to start with _ 🟠 🟢

General JSDoc rules

Name Description 🟠 🟢
jsdoc/no-undefined-types Rule is disabled to allow some undefined types 🟠
jsdoc/require-description Requires all functions to have a description in their JSDoc 🟢
jsdoc/require-param-description Rule is disabled as we don't write any description for @param tags 🟠 🟢
jsdoc/require-property-description Rule is disabled as we don't write any description for @property tags 🟠 🟢
jsdoc/require-jsdoc Enforces JSDoc comments on functions and classes 🟠 🟢
jsdoc/sort-tags Enforces specific order for tags 🟠 🟢

Crisp JSDoc rules

Name Description 🟠 🟢
crisp/jsdoc-align-params Enforces various alignments 🟠 🟢
crisp/jsdoc-check-indentation Enforces consistent indentation 🟠 🟢
crisp/jsdoc-check-optional-params Requires optional parameters to be surrounded by brackets 🟢
crisp/jsdoc-enforce-access Requires one of @public, @private, or @protected for functions 🟢
crisp/jsdoc-enforce-classdesc Ensures JSDoc for class headers to include a non-empty @classdesc 🟠 🟢
crisp/jsdoc-require-description-uppercase Requires descriptions to start with an uppercase character 🟠 🟢

General Vue rules

Name Description 🟠 🟢
vue/attributes-order Enforces order of attributes 🟢
vue/block-lang Allows script blocks to have no lang attribute 🟢
vue/block-order Enforces order of component top-level elements (template, then script, then style) 🟢
vue/block-tag-newline Requires one line break after opening and before closing block-level tags 🟢
vue/comma-dangle Disallows trailing commas in <template> 🟢
vue/component-api-style Enforces Options API style 🟢
vue/component-name-in-template-casing Enforces tag names to kebab case 🟢
vue/component-options-name-casing Enforces component names in components options to pascal case 🟢
vue/custom-event-name-casing Enforces custom event names to camel case 🟢
vue/eqeqeq Requires the use of === and !== in <template> 🟢
vue/html-comment-content-spacing Requires one space before and after HTML comment tags 🟢
vue/html-quotes Rule is disabled in order to allow backticks in HTML attributes 🟢
vue/key-spacing Enforces 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-name Requires the registered component name to match the imported component name 🟢
vue/max-len Enforces a maximum line length of 80 characters (only for <script>) 🟢
vue/new-line-between-multi-line-property Requires new lines between multi-line props 🟢
vue/no-bare-strings-in-template Disallows the use of bare strings in <template> 🟢
vue/no-implicit-coercion Disallows short notations for type conversion 🟢
vue/no-irregular-whitespace Disallows irregular / invalid whitespaces 🟢
vue/no-multiple-objects-in-class Disallows to pass multiple objects into array to class HTML property 🟢
vue/no-mutating-props Disallows mutation of component props (except shallow mutation) 🟢
vue/no-static-inline-styles Disallows static inline style attributes 🟢
vue/no-use-v-else-with-v-for Disallows using v-else-if/v-else on the same element as v-for (works but confusing) 🟢
vue/no-useless-v-bind Disallows unnecessary v-bind directives 🟢
vue/no-v-html Rule is disabled in order to allow the use of v-html 🟢
vue/padding-line-between-blocks Requires padding lines between blocks 🟢
vue/padding-lines-in-component-definition Requires padding lines in component definition 🟢
vue/prefer-true-attribute-shorthand Requires shorthand form attribute when v-bind value is true 🟢
vue/require-direct-export Requires the component to be directly exported 🟢
vue/slot-name-casing Enforces slot names to kebab case 🟢
vue/v-for-delimiter-style Enforces the use of in delimiter in v-for directive 🟢
vue/v-slot-style Disallows v-slot shorthand style 🟢

Crisp Vue rules

Name Description 🟠 🟢
crisp/vue-attribute-comma Disallows trailing comma after attribute 🟢
crisp/vue-attribute-linebreak Enforces linebreak before first attribute and after last attribute 🟢
crisp/vue-computed-order Ensures computed properties are alphabetically ordered 🟢
crisp/vue-emits-order Ensures emits properties are alphabetically ordered 🟢
crisp/vue-header-check Ensures script, template and style tags start with corresponding comment block 🟢
crisp/vue-html-indent Enforces consistent indentation in template (supports for Pug) 🟢
crisp/vue-html-quotes Enforces HTML attributes to be enclosed with double quotes 🟢
crisp/vue-no-regex-data Disallows regular expressions to be declared in Vue data object 🟢
crisp/vue-props-declaration-line-break Enforces line break between type and default function in prop definition 🟢
crisp/vue-props-declaration-multiline Enforces props declarations to be multiline 🟢
crisp/vue-props-declaration-order Ensures props declarations are alphabetically ordered 🟢
crisp/vue-ref-case Enforces ref attributes to snake case 🟢

License

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.9
1latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.9
1
1.1.8
2
1.1.7
0
1.1.6
0
1.1.5
0
1.1.4
0
1.1.3
0
1.1.2
0
1.1.1
0
1.1.0
0
1.0.103
0
1.0.102
0
1.0.101
0
1.0.100
0
1.0.99
0
1.0.98
0
1.0.97
0
1.0.96
0
1.0.95
0
1.0.94
0
1.0.93
0
1.0.92
0
1.0.91
1
1.0.90
0
1.0.89
0
1.0.88
0
1.0.87
0
1.0.86
1
1.0.85
0
1.0.84
0
1.0.83
0
1.0.82
0
1.0.81
0
1.0.80
0
1.0.79
0
1.0.78
0
1.0.77
0
1.0.76
0
1.0.75
0
1.0.74
0
1.0.73
0
1.0.72
0
1.0.71
0
1.0.70
0
1.0.69
0
1.0.68
0
1.0.67
0
1.0.66
0
1.0.65
0
1.0.64
0
1.0.63
0
1.0.62
0
1.0.61
0
1.0.60
0
1.0.59
0
1.0.58
0
1.0.57
0
1.0.530
1.0.520
1.0.510
1.0.500
1.0.490
1.0.480
1.0.470
1.0.460
1.0.450
1.0.440
1.0.430
1.0.410
1.0.420
1.0.400
1.0.390
1.0.380
1.0.370
1.0.360
1.0.350
1.0.340
1.0.330
1.0.320
1.0.310
1.0.300
1.0.290
1.0.280
1.0.270
1.0.260
1.0.250
1.0.230
1.0.220
1.0.210
1.0.200
1.0.190
1.0.180
1.0.170
1.0.160
1.0.150
1.0.140
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i eslint-plugin-crisp

Weekly Downloads

5

Version

1.1.9

License

MIT

Unpacked Size

137 kB

Total Files

50

Last publish

Collaborators

  • baptistejamin
  • crisp-dev