New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More β†’
Socket
Sign inDemoInstall
Socket

eslint-plugin-crisp

Package Overview
Dependencies
Maintainers
0
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-crisp

Custom ESLint Rules for Crisp

  • 1.0.101
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-80.3%
Maintainers
0
Weekly downloads
Β 
Created
Source

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.

Keywords

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc