eslint-plugin-itgalaxy
Version:
Itgalaxy org's ESLint rules and configs.
296 lines (293 loc) • 13.2 kB
JavaScript
;
// see http://eslint.org/docs/rules/#stylistic-issues
module.exports = {
// Enforce linebreaks after opening and before closing array brackets
"@stylistic/array-bracket-newline": "off",
// Enforce consistent spacing inside array brackets
"@stylistic/array-bracket-spacing": "off",
// Enforce line breaks after each array element
"@stylistic/array-element-newline": "off",
// Require parentheses around arrow function arguments
"@stylistic/arrow-parens": "off",
// Enforce consistent spacing before and after the arrow in arrow functions
"@stylistic/arrow-spacing": "off",
// Enforce line breaks after each array element
"@stylistic/block-spacing": "off",
// Enforce consistent spacing inside single-line blocks
"@stylistic/brace-style": "off",
// Require or disallow trailing commas
"@stylistic/comma-dangle": "off",
// Enforce spacing before and after comma
"@stylistic/comma-spacing": "off",
// Enforce one true comma style
"@stylistic/comma-style": "off",
// Require or disallow padding inside computed properties
"@stylistic/computed-property-spacing": "off",
// Enforce consistent newlines before and after dots
"@stylistic/dot-location": "off",
// Enforce newline at the end of file, with no multiple empty lines
"@stylistic/eol-last": "off",
// Require or disallow spacing between function identifiers and their invocations
"@stylistic/func-call-spacing": "off",
// Enforce line breaks between arguments of a function call
"@stylistic/function-call-argument-newline": "off",
// Require or disallow spacing between function identifiers and their invocations
"@stylistic/function-call-spacing": "off",
// Enforce consistent line breaks inside function parentheses
"@stylistic/function-paren-newline": "off",
// Enforce consistent spacing around `*` operators in generator functions
"@stylistic/generator-star-spacing": "off",
// Enforce the location of arrow function bodies
"@stylistic/implicit-arrow-linebreak": "off",
// This option sets a specific tab width for your code
"@stylistic/indent": "off",
// Indentation for binary operators
"@stylistic/indent-binary-ops": "off",
// Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
"@stylistic/jsx-child-element-spacing": "off",
// Enforce closing bracket location in JSX
"@stylistic/jsx-closing-bracket-location": "off",
// Enforce closing tag location for multiline JSX
"@stylistic/jsx-closing-tag-location": "off",
// Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
"@stylistic/jsx-curly-brace-presence": "off",
// Enforce consistent linebreaks in curly braces in JSX attributes and expressions
"@stylistic/jsx-curly-newline": "off",
// Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
"@stylistic/jsx-curly-spacing": "off",
// Enforce or disallow spaces around equal signs in JSX attributes
"@stylistic/jsx-equals-spacing": "off",
// Enforce proper position of the first property in JSX
"@stylistic/jsx-first-prop-new-line": "off",
// Enforce line breaks before and after JSX elements when they are used as arguments to a function.
"@stylistic/jsx-function-call-newline": "off",
// Enforce JSX indentation. Deprecated, use `indent` rule instead.
"@stylistic/jsx-indent": "off",
// Enforce props indentation in JSX
"@stylistic/jsx-indent-props": "off",
// Enforce maximum of props on a single line in JSX
"@stylistic/jsx-max-props-per-line": "off",
// Require or prevent a new line after jsx elements and expressions.
"@stylistic/jsx-newline": "off",
// Require one JSX element per line
"@stylistic/jsx-one-expression-per-line": "off",
// Enforce PascalCase for user-defined JSX components
"@stylistic/jsx-pascal-case": "off",
// Disallow multiple spaces between inline JSX props
"@stylistic/jsx-props-no-multi-spaces": "off",
// Enforce the consistent use of either double or single quotes in JSX attributes
"@stylistic/jsx-quotes": "off",
// Disallow extra closing tags for components without children
"@stylistic/jsx-self-closing-comp": "off",
// Enforce props alphabetical sorting
"@stylistic/jsx-sort-props": "off",
// Enforce whitespace in and around the JSX opening and closing brackets
"@stylistic/jsx-tag-spacing": "off",
// Disallow missing parentheses around multiline JSX
"@stylistic/jsx-wrap-multilines": "off",
// Enforces spacing between keys and values in object literal properties
"@stylistic/key-spacing": "off",
// Enforce spacing before and after keywords
"@stylistic/keyword-spacing": "off",
// Enforce position of line comments
"@stylistic/line-comment-position": "off",
// Disallow mixed "LF" and "CRLF" as linebreaks
"@stylistic/linebreak-style": "off",
// Enforces empty lines around comments
"@stylistic/lines-around-comment": "off",
// Require or disallow an empty line between class members
"@stylistic/lines-between-class-members": "error",
// Enforce a maximum line length
"@stylistic/max-len": "off",
// Enforce a maximum number of statements allowed per line
"@stylistic/max-statements-per-line": "off",
// Require a specific member delimiter style for interfaces and type literals
"@stylistic/member-delimiter-style": "off",
// Enforce a particular style for multiline comments
// Comments can be different
"@stylistic/multiline-comment-style": "off",
// Enforce newlines between operands of ternary expressions
"@stylistic/multiline-ternary": "off",
// Disallow the omission of parentheses when invoking a constructor with no arguments
"@stylistic/new-parens": "off",
// Enforce newline after each call when chaining the calls
"@stylistic/newline-per-chained-call": "off",
// Disallow arrow functions where they could be confused with comparisons
"@stylistic/no-confusing-arrow": "off",
// Disallow unnecessary parentheses
"@stylistic/no-extra-parens": "off",
// Disallow unnecessary semicolons
"@stylistic/no-extra-semi": "off",
// Disallow leading or trailing decimal points in numeric literals
"@stylistic/no-floating-decimal": "off",
// Disallow mixed spaces and tabs for indentation
"@stylistic/no-mixed-operators": "off",
// Disallow mixed spaces and tabs for indentation
"@stylistic/no-mixed-spaces-and-tabs": "off",
// Disallow multiple spaces
"@stylistic/no-multi-spaces": "off",
// Disallow multiple empty lines
"@stylistic/no-multiple-empty-lines": "off",
// Disallow all tabs
"@stylistic/no-tabs": "off",
// Disallow trailing whitespace at the end of lines
"@stylistic/no-trailing-spaces": "off",
// Disallow whitespace before properties
"@stylistic/no-whitespace-before-property": "off",
// Disallow whitespace before properties
"@stylistic/nonblock-statement-body-position": "off",
// Disallow dangling underscores in identifiers
"@stylistic/object-curly-newline": "off",
// Require or disallow padding inside curly braces
"@stylistic/object-curly-spacing": "off",
// Enforce placing object properties on separate lines
"@stylistic/object-property-newline": "off",
// Require or disallow newlines around variable declarations
"@stylistic/one-var-declaration-per-line": "off",
// Enforce consistent linebreak style for operators
"@stylistic/operator-linebreak": "off",
// Enforce padding within blocks
"@stylistic/padded-blocks": "off",
// Require or disallow padding lines between statements
"@stylistic/padding-line-between-statements": [
"error",
// Statement `block` does't need to be covered
// Newline between `block-like` (this matches statements that the last token is the closing brace of blocks)
{
blankLine: "always",
prev: ["block-like"],
next: "*",
},
{
blankLine: "always",
prev: "*",
next: ["block-like"],
},
// Allow any newlines between `expression`
{
blankLine: "any",
prev: ["expression"],
next: ["expression"],
},
// Disable newline between `expression` and `break`
// Require newline between `block-like` and `break`
// Statement `break` does't need to be covered
// Disable newline before and after `case`
{ blankLine: "never", prev: ["case"], next: "*" },
{ blankLine: "never", prev: "*", next: ["case"] },
// Require newline between blocks of `cjs-export` and any lines between `cjs-export`
{ blankLine: "always", prev: ["cjs-export"], next: "*" },
{ blankLine: "always", prev: "*", next: ["cjs-export"] },
{
blankLine: "any",
prev: ["cjs-export"],
next: ["cjs-export"],
},
// Require newline between blocks of `cjs-import` and any lines between `cjs-import`
{ blankLine: "always", prev: ["cjs-import"], next: "*" },
{ blankLine: "always", prev: "*", next: ["cjs-import"] },
{
blankLine: "any",
prev: ["cjs-import"],
next: ["cjs-import"],
},
// Statement `class` is covered `block-like`
// Require newline between blocks of `const`,`let`,`var` and any lines between `const`,`let`,`var`
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
{ blankLine: "always", prev: "*", next: ["const", "let", "var"] },
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"],
},
// Statement `const` is covered above
// Statement `continue` does't need to be covered
// Statement `debugger` does't need to be covered
// Disable newline before and after `default`
{ blankLine: "never", prev: ["default"], next: "*" },
{ blankLine: "never", prev: "*", next: ["default"] },
// Require newline between directive and never newlines between directive
{ blankLine: "always", prev: "directive", next: "*" },
{ blankLine: "never", prev: "directive", next: "directive" },
// Statement `do` is covered `block-like`
// Statement `empty` does't need to be covered
// Require newline between blocks of `export` and any lines between `export`
{ blankLine: "always", prev: ["export"], next: "*" },
{ blankLine: "always", prev: "*", next: ["export"] },
{
blankLine: "any",
prev: ["export"],
next: ["export"],
},
// Statement `for` is covered `block-like`
// Statement `function` is covered `block-like`
// Statement `if` is covered `block-like`
// Require newline between blocks of `import` and any lines between `import`
{ blankLine: "always", prev: ["import"], next: "*" },
{ blankLine: "always", prev: "*", next: ["import"] },
{
blankLine: "any",
prev: ["import"],
next: ["import"],
},
],
// Require quotes around object literal property names
"@stylistic/quote-props": "off",
// Specify whether backticks, double or single quotes should be used
"@stylistic/quotes": [
"error",
"double",
{ avoidEscape: true, allowTemplateLiterals: false },
],
"@stylistic/rest-spread-spacing": "off",
// Require or disallow use of semicolons instead of ASI
"@stylistic/semi": "off",
// Enforce spacing before and after semicolons
"@stylistic/semi-spacing": "off",
// Enforce location of semicolons
"@stylistic/semi-style": "off",
// Require or disallow space before blocks
"@stylistic/space-before-blocks": "off",
// Require or disallow space before function opening parenthesis
"@stylistic/space-before-function-paren": "off",
// Require or disallow spaces inside parentheses
"@stylistic/space-in-parens": "off",
// Require spaces around operators
"@stylistic/space-infix-ops": "off",
// Require or disallow spaces before/after unary operators (words on by default, nonwords)
"@stylistic/space-unary-ops": "off",
// Require or disallow a space immediately following the // or /* in a comment
"@stylistic/spaced-comment": [
"error",
"always",
{
line: {
markers: ["=", "!"], // Space here to support sprockets directives
exceptions: ["-", "+"],
},
block: {
markers: ["=", "!"], // Space here to support sprockets directives
exceptions: ["-", "+"],
balanced: true,
},
},
],
// Enforce spacing around colons of switch statements
"@stylistic/switch-colon-spacing": "off",
// Require or disallow spacing around embedded expressions of template strings
"@stylistic/template-curly-spacing": "off",
// Require or disallow spacing between template tags and their literals
"@stylistic/template-tag-spacing": "off",
// Require consistent spacing around type annotations
"@stylistic/type-annotation-spacing": "off",
// Enforces consistent spacing inside TypeScript type generics
"@stylistic/type-generic-spacing": "off",
// Expect space before the type declaration in the named tuple
"@stylistic/type-named-tuple-spacing": "off",
// Require parenthesis around regex literals
"@stylistic/wrap-iife": "off",
// Require regex literals to be wrapped in parentheses
"@stylistic/wrap-regex": "off",
// Require or disallow spacing around the `*` in `yield*` expressions
"@stylistic/yield-star-spacing": "off",
};