0.1.1 • Published 5 years ago

eslint-config-xzymodule v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

eslint-config-hyperchain

travis npm MIT

ESLint Shareable Config For React App

Installation

Install peerDependencies.

# npm
npm install eslint eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react  --save-dev

# yarn
yarn add eslint eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react --dev

Install This Config

# npm 
npm install eslint-config-hyperchain --save-dev 

# yarn 
yarn add eslint-config-hyperchain --dev

Configuration

Configure the following content in .eslintrc.js

  "extends": [
    "hyperchain"
  ]

Base Rules

Possible Errors

ruledescription
no-compare-neg-zerodisallow comparing against -0
no-cond-assigndisallow assignment operators in conditional expressions
no-constant-conditiondisallow constant expressions in conditions
no-control-regexdisallow control characters in regular expressions
no-debuggerdisallow the use of debugger
no-dupe-argsdisallow duplicate arguments in function definitions
no-dupe-keysdisallow duplicate keys in object literals
no-duplicate-casedisallow duplicate case labels
no-empty-character-classdisallow empty character classes in regular expressions
no-ex-assigndisallow reassigning exceptions in catch clauses
no-extra-boolean-castdisallow unnecessary boolean casts
no-extra-parensdisallow unnecessary parentheses
no-func-assigndisallow reassigning function declarations
no-inner-declarationsdisallow variable or function declarations in nested blocks
no-invalid-regexpdisallow invalid regular expression strings in RegExp constructors
no-irregular-whitespacedisallow irregular whitespace outside of strings and comments
no-obj-callsdisallow calling global object properties as functions
no-regex-spacesdisallow multiple spaces in regular expressions
no-sparse-arraysdisallow sparse arrays
no-template-curly-in-stringdisallow template literal placeholder syntax in regular strings
no-unexpected-multilinedisallow confusing multiline expressions
no-unreachabledisallow unreachable code after return, throw, continue, and break statements
no-unsafe-finallydisallow control flow statements in finally blocks
no-unsafe-negationdisallow negating the left operand of relational operators
use-isnanrequire calls to isNaN() when checking for NaN
valid-typeofenforce comparing typeof expressions against valid strings

Best Practices

ruledescription
accessor-pairsenforce getter and setter pairs in objects
curlyenforce consistent brace style for all control statements
dot-locationenforce consistent newlines before and after dots
eqeqeqrequire the use of === and !==
no-callerdisallow the use of arguments.caller or arguments.callee
no-empty-patterndisallow empty destructuring patterns
no-evaldisallow the use of eval()
no-extend-nativedisallow extending native types
no-extra-binddisallow unnecessary calls to .bind()
no-fallthroughdisallow fallthrough of case statements
no-floating-decimaldisallow leading or trailing decimal points in numeric literals
no-global-assigndisallow assignments to native objects or read-only global variables
no-implied-evaldisallow the use of eval()-like methods
no-iteratordisallow the use of the iterator property
no-labelsdisallow labeled statements
no-lone-blocksdisallow unnecessary nested blocks
no-multi-spacesdisallow multiple spaces
no-multi-strdisallow multiline strings
no-newdisallow new operators outside of assignments or comparisons
no-new-funcdisallow new operators with the Function object
no-new-wrappersdisallow new operators with the String, Number, and Boolean objects
no-octaldisallow octal literals
no-octal-escapedisallow octal escape sequences in string literals
no-protodisallow the use of the proto property
no-redeclaredisallow variable redeclaration
no-return-assigndisallow assignment operators in return statements
no-return-awaitdisallow unnecessary return await
no-self-assigndisallow assignments where both sides are exactly the same
no-self-comparedisallow comparisons where both sides are exactly the same
no-sequencesdisallow comma operators
no-throw-literaldisallow throwing literals as exceptions
no-unmodified-loop-conditiondisallow unmodified loop conditions
no-unused-expressionsdisallow unused expressions
no-useless-calldisallow unnecessary calls to .call() and .apply()
no-useless-escapedisallow unnecessary escape characters
no-useless-returndisallow redundant return statements
no-withdisallow with statements
prefer-promise-reject-errorsrequire using Error objects as Promise rejection reasons
wrap-iiferequire parentheses around immediate function invocations
yodarequire or disallow “Yoda” conditions

Variables

ruledescription
no-delete-vardisallow deleting variables
no-label-vardisallow labels that share a name with a variable
no-shadow-restricted-namesdisallow identifiers from shadowing restricted names
no-undefdisallow the use of undeclared variables unless mentioned in /global / comments
no-undef-initdisallow initializing variables to undefined
no-unused-varsdisallow unused variables
no-use-before-definedisallow the use of variables before they are defined

Node.js and CommonJS

ruledescription
handle-callback-errrequire error handling in callbacks
no-new-requiredisallow new operators with calls to require
no-path-concatdisallow string concatenation with dirname and filename

Stylistic Issues

ruledescription
block-spacingdisallow or enforce spaces inside of blocks after opening block and before closing block
brace-styleenforce consistent brace style for blocks
camelcaseenforce camelcase naming convention
comma-danglerequire or disallow trailing commas
comma-spacingenforce consistent spacing before and after commas
comma-styleenforce consistent comma style
eol-lastrequire or disallow newline at the end of files
func-call-spacingrequire or disallow spacing between function identifiers and their invocations
indentenforce consistent indentation
key-spacingenforce consistent spacing between keys and values in object literal properties
keyword-spacingenforce consistent spacing before and after keywords
new-caprequire constructor names to begin with a capital letter
new-parensrequire parentheses when invoking a constructor with no arguments
no-array-constructordisallow Array constructors
no-mixed-operatorsdisallow mixed binary operators
no-mixed-spaces-and-tabsdisallow mixed spaces and tabs for indentation
no-multiple-empty-linesdisallow multiple empty lines
no-new-objectdisallow Object constructors
no-tabsdisallow all tabs
no-trailing-spacesdisallow trailing whitespace at the end of lines
no-unneeded-ternarydisallow ternary operators when simpler alternatives exist
no-whitespace-before-propertydisallow whitespace before properties
object-curly-spacingenforce consistent spacing inside braces
object-property-newlineenforce placing object properties on separate lines
one-varenforce variables to be declared either together or separately in functions
operator-linebreakenforce consistent linebreak style for operators
padded-blocksrequire or disallow padding within blocks
quotesenforce the consistent use of either backticks, double, or single quotes
semirequire or disallow semicolons instead of ASI
semi-spacingenforce consistent spacing before and after semicolons
space-before-blocksenforce consistent spacing before blocks
space-before-function-parenenforce consistent spacing before function definition opening parenthesis
space-in-parensenforce consistent spacing inside parentheses
space-infix-opsrequire spacing around infix operators
space-unary-opsenforce consistent spacing before or after unary operators
spaced-commentenforce consistent spacing after the // or /* in a comment
template-tag-spacingrequire or disallow spacing between template tags and their literals
unicode-bomrequire or disallow Unicode byte order mark (BOM)

ECMAScript 6

ruledescription
arrow-spacingenforce consistent spacing before and after the arrow in arrow functions
constructor-superrequire super() calls in constructors
generator-star-spacingenforce consistent spacing around * operators in generator functions
no-class-assigndisallow reassigning class members
no-const-assigndisallow reassigning const variables
no-dupe-class-membersdisallow duplicate class members
no-new-symboldisallow new operators with the Symbol object
no-this-before-superdisallow this/super before calling super() in constructors
no-useless-computed-keydisallow unnecessary computed property keys in object literals
no-useless-constructordisallow unnecessary constructors
no-useless-renamedisallow renaming import, export, and destructured assignments to the same name
rest-spread-spacingenforce spacing between rest and spread operators and their expressions
symbol-descriptionrequire symbol descriptions
template-curly-spacingrequire or disallow spacing around embedded expressions of template strings
yield-star-spacingrequire or disallow spacing around the in yield expressions

Other Rules

License

eslint-congfig-hyperchain is licensed under the MIT License.