Skip to content

Instantly share code, notes, and snippets.

@brokenmass
Last active October 21, 2016 09:40
Show Gist options
  • Save brokenmass/68b00c2cf7818762142de34257e117ad to your computer and use it in GitHub Desktop.
Save brokenmass/68b00c2cf7818762142de34257e117ad to your computer and use it in GitHub Desktop.
{
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"jsx": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"octalLiterals": true,
"regexUFlag": true,
"regexYFlag": true,
"restParams": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"unicodeCodePointEscapes": true
},
"env": {
"browser": true,
"es6": true,
"mocha": true,
"node": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"no-use-extend-native",
"babel",
"import",
"flowtype",
"mocha",
"jsdoc",
"lodash",
"promise",
"react"
],
"rules": {
"accessor-pairs": 2, // enforce getter and setter pairs in objects
"array-bracket-spacing": [ // enforce consistent spacing inside array brackets [AUTOFIX]
0,
"never"
],
"array-callback-return": 2, // enforce return statements in callbacks of array methods
"arrow-body-style": [ // require braces around arrow function bodies
2,
"always"
],
"arrow-parens": [ // require parentheses around arrow function arguments [AUTOFIX]
0,
"always"
],
"arrow-spacing": [ // enforce consistent spacing before and after the arrow in arrow functions [AUTOFIX]
2,
{
"after": true,
"before": true
}
],
"babel/array-bracket-spacing": [ // Handles destructuring arrays with flow type in function parameters [AUTOFIX]
0,
"never"
],
"babel/arrow-parens": [ // Handles async functions correctly [AUTOFIX]
2,
"always"
],
"babel/flow-object-type": [ // Require a particular separator between properties in Flow object types. [AUTOFIX]
2,
"comma"
],
"babel/func-params-comma-dangle": [ // Require or forbid trailing commas for function paramater lists. [AUTOFIX]
2,
"never"
],
"babel/generator-star-spacing": 1, // Handles async/await functions correctly
"babel/new-cap": 0, // Ignores capitalized decorators (@Decorator)
"babel/no-await-in-loop": 2, // guard against awaiting async functions inside of a loop [AUTOFIX]
"babel/object-curly-spacing": [ // doesn't complain about export x from "mod"; or export * as x from "mod"; [AUTOFIX]
2,
"never"
],
"babel/object-shorthand": [ // doesn't fail when using object spread (...obj)
2,
"always"
],
"block-scoped-var": 2, // enforce the use of variables within the scope they are defined
"block-spacing": [ // enforce consistent spacing inside single-line blocks [AUTOFIX]
2,
"always"
],
"brace-style": [ // enforce consistent brace style for blocks
2,
"1tbs",
{
"allowSingleLine": true
}
],
"callback-return": 2, // require return statements after callbacks
"camelcase": 0, // enforce camelcase naming convention
"class-methods-use-this": 2, // enforce that class methods utilize this
"comma-dangle": [ // require or disallow trailing commas [AUTOFIX]
2,
"never"
],
"comma-spacing": [ // enforce consistent spacing before and after commas [AUTOFIX]
2,
{
"after": true,
"before": false
}
],
"comma-style": [ // enforce consistent comma style [AUTOFIX]
2,
"last"
],
"complexity": [ // enforce a maximum cyclomatic complexity allowed in a program
1,
10
],
"computed-property-spacing": [ // enforce consistent spacing inside computed property brackets [AUTOFIX]
2,
"never"
],
"consistent-return": 2, // require return statements to either always or never specify values
"consistent-this": [ // enforce consistent naming when capturing the current execution context
2,
"self"
],
"constructor-super": 2, // require super() calls in constructors [RECOMMENDED]
"curly": 2, // enforce consistent brace style for all control statements [AUTOFIX]
"default-case": 0, // require default cases in switch statements
"dot-location": [ // enforce consistent newlines before and after dots [AUTOFIX]
2,
"property"
],
"dot-notation": 2, // enforce dot notation whenever possible [AUTOFIX]
"eol-last": 2, // require or disallow newline at the end of files [AUTOFIX]
"eqeqeq": 2, // require the use of === and !==
"flowtype/boolean-style": [ // Enforces a particular style for boolean type annotations. [RECOMMENDED]
2,
"boolean"
],
"flowtype/define-flow-type": 2, // Marks Flow type identifiers as defined, Used to suppress [`no-undef`] reporting of type identifiers.
"flowtype/generic-spacing": [ // Enforces consistent spacing within generic type annotation parameters. [RECOMMENDED]
2,
"never"
],
"flowtype/require-parameter-type": 0, // Requires that all function parameters have type annotations.
"flowtype/require-return-type": 0, // Requires that functions have return type annotation.
"flowtype/require-valid-file-annotation": 2, // This rule validates Flow file annotations.
"flowtype/semi": [ // Enforces consistent use of semicolons after type aliases.
2,
"always"
],
"flowtype/space-after-type-colon": [ // Enforces consistent spacing after the type annotation colon. [RECOMMENDED]
2,
"always"
],
"flowtype/space-before-generic-bracket": [ // Enforces consistent spacing before the opening `<` of generic type annotation parameters. [RECOMMENDED]
2,
"never"
],
"flowtype/space-before-type-colon": [ // Enforces consistent spacing before the type annotation colon.
1,
"never"
],
"flowtype/type-id-match": [ // Enforces a consistent naming pattern for type aliases.
2,
"^Type([A-Z][a-z0-9]+)+$"
],
"flowtype/union-intersection-spacing": [ // Enforces consistent spacing around union and intersection type separators (`|` and `&`). [RECOMMENDED]
2,
"always"
],
"flowtype/use-flow-type": 2, // Marks Flow type alias declarations as used.
"flowtype/valid-syntax": 2, // **Deprecated** Babylon (the Babel parser) v6.10.0 fixes parsing of the invalid syntax this plugin warned against.
"func-call-spacing": [ // require or disallow spacing between function identifiers and their invocations [AUTOFIX]
2,
"never"
],
"func-name-matching": 2, // require function names to match the name of the variable or property to which they are assigned
"func-names": 0, // require or disallow named function expressions
"func-style": [ // enforce the consistent use of either function declarations or expressions
2,
"expression"
],
"generator-star-spacing": [ // enforce consistent spacing around * operators in generator functions [AUTOFIX]
0,
{
"after": false,
"before": true
}
],
"global-require": 2, // require require() calls to be placed at top-level module scope
"guard-for-in": 2, // require for-in loops to include an if statement
"handle-callback-err": 2, // require error handling in callbacks
"id-length": [ // enforce minimum and maximum identifier lengths
1,
{
"exceptions": [
"P",
"R",
"$",
"_"
],
"max": 50,
"min": 2
}
],
"id-match": [ // require identifiers to match a specified regular expression
2,
"(^[A-Za-z]+(?:[A-Z][a-z]*)*\\d*$)|(^[A-Z]+(_[A-Z]+)*(_\\d$)*$)|(^(_|\\$)$)",
{
"onlyDeclarations": true,
"properties": true
}
],
"import/default": 2, // Ensure a default export is present, given a default import.
"import/export": 2, // Report any invalid exports, i.e. re-export of the same name
"import/extensions": [ // Ensure consistent use of file extension within the import path
0,
"never"
],
"import/imports-first": [ // UNKNOWN RULE
2,
{
"absolute-first": true
}
],
"import/named": 2, // Ensure named imports correspond to a named export in the remote file.
"import/namespace": 2, // Ensure imported namespaces contain dereferenced properties as they are dereferenced.
"import/newline-after-import": 2, // Enforce a newline after import statements
"import/no-amd": 2, // Report AMD require and define calls.
"import/no-commonjs": 2, // Report CommonJS require calls and module.exports or exports.*.
"import/no-deprecated": 1, // Report imported names marked with @deprecated documentation tag
"import/no-duplicates": 0, // Report repeated import of the same module in multiple places
"import/no-extraneous-dependencies": [ // Forbid the use of extraneous packages
2,
{
"devDependencies": true,
"optionalDependencies": true
}
],
"import/no-mutable-exports": 2, // Forbid the use of mutable exports with var or let.
"import/no-named-as-default": 2, // Report use of exported name as identifier of default export
"import/no-named-as-default-member": 2, // Report use of exported name as property of default export
"import/no-namespace": 2, // Report namespace imports
"import/no-nodejs-modules": 0, // No Node.js builtin modules.
"import/no-restricted-paths": 0, // Restrict which files can be imported in a given folder
"import/no-unresolved": 2, // Ensure imports point to a file/module that can be resolved.
"import/order": [ // Enforce a convention in module import order
2,
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
],
"newlines-between": "never"
}
],
"import/prefer-default-export": 1, // Prefer a default export if module exports a single name
"indent": [ // enforce consistent indentation [AUTOFIX]
2,
2
],
"init-declarations": [ // require or disallow initialization in variable declarations
2,
"never",
{
"ignoreForLoopInit": false
}
],
"jsdoc/check-param-names": 1, // Ensures that parameter names in JSDoc match those in the function declaration.
"jsdoc/check-tag-names": 1, // Reports invalid block tag names.
"jsdoc/check-types": 1, // Reports invalid types.
"jsdoc/newline-after-description": [ // Enforces a consistent padding of the block description.
1,
"always"
],
"jsdoc/require-description-complete-sentence": 1, // Requires that block description and tag description are written in complete sentences
"jsdoc/require-hyphen-before-description": 0, // UNKNOWN RULE
"jsdoc/require-param": 0, // Requires that all function parameters are documented.
"jsdoc/require-param-description": 0, // Requires that @param tag has description value.
"jsdoc/require-param-type": 0, // Requires that @param tag has type value.
"jsdoc/require-returns-description": 0, // Requires that @returns tag has description value.
"jsdoc/require-returns-type": 0, // Requires that @returns tag has type value.
"jsx-quotes": [ // enforce the consistent use of either double or single quotes in JSX attributes [AUTOFIX]
2,
"prefer-single"
],
"key-spacing": [ // enforce consistent spacing between keys and values in object literal properties [AUTOFIX]
2,
{
"afterColon": true,
"beforeColon": false
}
],
"keyword-spacing": [ // enforce consistent spacing before and after keywords [AUTOFIX]
2,
{
"after": true,
"before": true
}
],
"line-comment-position": [ // enforce position of line comments
2,
{
"position": "above"
}
],
"linebreak-style": [ // enforce consistent linebreak style [AUTOFIX]
2,
"unix"
],
"lines-around-comment": [ // require empty lines around comments [AUTOFIX]
2,
{
"beforeBlockComment": false,
"beforeLineComment": false
}
],
"lines-around-directive": [ // require or disallow newlines around directives [AUTOFIX]
2,
"always"
],
"lodash/callback-binding": 1, // Use or avoid thisArg for Lodash method callbacks, depending on major version.
"lodash/chain-style": [ // Enforce a specific chain style: explicit, implicit, or explicit only when necessary.
1,
"explicit"
],
"lodash/collection-method-value": 1, // Use value returned from collection methods properly.
"lodash/collection-return": 1, // Always return a value in iteratees of Lodash collection methods that aren't forEach.
"lodash/consistent-compose": [ // Enforce a specific function composition direction: flow or flowRight.
1,
"flow"
],
"lodash/identity-shorthand": [ // Prefer identity shorthand syntax
1,
"always"
],
"lodash/matches-prop-shorthand": 1, // Prefer matches property shorthand syntax
"lodash/matches-shorthand": [ // Prefer matches shorthand syntax
1,
"always",
3
],
"lodash/no-commit": 1, // Do not use .commit() on chains that should end with .value()
"lodash/no-double-unwrap": 1, // Do not use .value() on chains that have already ended (e.g. with max() or reduce()) [AUTOFIX]
"lodash/no-extra-args": 1, // Do not use superfluous arguments on Lodash methods with a specified arity.
"lodash/no-single-chain": 1, // UNKNOWN RULE
"lodash/path-style": 0, // Enforce a specific path style for methods like get and property: array, string, or arrays only for paths with variables.
"lodash/prefer-chain": 1, // UNKNOWN RULE
"lodash/prefer-compact": 1, // Prefer _.compact over _.filter for only truthy values.
"lodash/prefer-constant": 0, // Prefer _.constant over functions returning literals.
"lodash/prefer-filter": [ // Prefer _.filter over _.forEach with an if statement inside.
1,
3
],
"lodash/prefer-get": [ // Prefer using _.get or _.has over expression chains like a && a.b && a.b.c.
1,
3
],
"lodash/prefer-includes": 1, // Prefer _.includes over comparing indexOf to -1.
"lodash/prefer-invoke-map": 0, // Prefer using _.invoke over _.map with a method call inside.
"lodash/prefer-is-nil": 1, // Prefer _.isNil over checks for both null and undefined.
"lodash/prefer-lodash-chain": 1, // Prefer using Lodash chains (e.g. _.map) over native and mixed chains.
"lodash/prefer-lodash-method": 0, // Prefer using Lodash collection methods (e.g. _.map) over native array methods.
"lodash/prefer-lodash-typecheck": 1, // Prefer using _.is* methods over typeof and instanceof checks when applicable.
"lodash/prefer-map": 1, // Prefer _.map over _.forEach with a push inside.
"lodash/prefer-matches": 1, // Prefer _.matches over conditions like a.foo === 1 && a.bar === 2 && a.baz === 3.
"lodash/prefer-noop": 0, // Prefer _.noop over empty functions.
"lodash/prefer-over-quantifier": 1, // Prefer _.overSome and _.overEvery instead of checks with && and || for methods that have a boolean check iteratee.
"lodash/prefer-reject": [ // Prefer _.reject over filter with !(expression) or x.prop1 !== value
1,
3
],
"lodash/prefer-startswith": 0, // Prefer _.startsWith over a.indexOf(b) === 0.
"lodash/prefer-thru": 1, // Prefer using _.prototype.thru in the chain and not call functions in the initial value, e.g. _(x).thru(f).map(g)...
"lodash/prefer-times": 1, // Prefer _.times over _.map without using the iteratee's arguments.
"lodash/prefer-wrapper-method": 1, // Prefer using array and string methods in the chain and not the initial value, e.g. _(str).split(' ')...
"lodash/preferred-alias": 1, // Prefer using main method names instead of aliases. [AUTOFIX]
"lodash/prop-shorthand": 1, // Use/forbid property shorthand syntax.
"lodash/unwrap": 1, // Prevent chaining without evaluation via value() or non-chainable methods like max().,
"max-len": 1, // enforce a maximum line length
"max-nested-callbacks": [ // enforce a maximum depth that callbacks can be nested
1,
3
],
"max-statements-per-line": [ // enforce a maximum number of statements allowed per line
2,
{
"max": 1
}
],
"mocha/no-exclusive-tests": 2, // disallow exclusive mocha tests
"mocha/no-hooks-for-single-case": 1, // disallow hooks for a single test or test suite
"mocha/no-identical-title": 2, // disallow identical titles
"mocha/no-return-and-callback": 2, // disallow returning in a test or hook function that uses a callback
"mocha/no-top-level-hooks": 2, // disallow top-level hooks
"multiline-ternary": 0, // enforce newlines between operands of ternary expressions
"new-cap": [ // require constructor names to begin with a capital letter
0,
{
"capIsNew": false,
"newIsCap": true
}
],
"new-parens": 2, // require parentheses when invoking a constructor with no arguments [AUTOFIX]
"newline-after-var": [ // require or disallow an empty line after variable declarations
2,
"always"
],
"newline-before-return": 2, // require an empty line before return statements [AUTOFIX]
"newline-per-chained-call": 0, // require a newline after each call in a method chain
"no-alert": 2, // disallow the use of alert, confirm, and prompt
"no-array-constructor": 2, // disallow Array constructors
"no-caller": 2, // disallow the use of arguments.caller or arguments.callee
"no-case-declarations": 2, // disallow lexical declarations in case clauses [RECOMMENDED]
"no-catch-shadow": 2, // disallow catch clause parameters from shadowing variables in the outer scope
"no-class-assign": 2, // disallow reassigning class members [RECOMMENDED]
"no-cond-assign": 2, // disallow assignment operators in conditional expressions [RECOMMENDED]
"no-confusing-arrow": 2, // disallow arrow functions where they could be confused with comparisons
"no-console": 2, // disallow the use of console [RECOMMENDED]
"no-const-assign": 2, // disallow reassigning const variables [RECOMMENDED]
"no-constant-condition": 1, // disallow constant expressions in conditions [RECOMMENDED]
"no-continue": 2, // disallow continue statements
"no-control-regex": 2, // disallow control characters in regular expressions [RECOMMENDED]
"no-debugger": 1, // disallow the use of debugger [RECOMMENDED]
"no-delete-var": 2, // disallow deleting variables [RECOMMENDED]
"no-div-regex": 2, // disallow division operators explicitly at the beginning of regular expressions
"no-dupe-args": 2, // disallow duplicate arguments in function definitions [RECOMMENDED]
"no-dupe-class-members": 2, // disallow duplicate class members [RECOMMENDED]
"no-dupe-keys": 2, // disallow duplicate keys in object literals [RECOMMENDED]
"no-duplicate-case": 2, // disallow duplicate case labels [RECOMMENDED]
"no-duplicate-imports": 2, // disallow duplicate module imports
"no-else-return": 0, // disallow else blocks after return statements in if statements
"no-empty": 1, // disallow empty block statements [RECOMMENDED]
"no-empty-character-class": 2, // disallow empty character classes in regular expressions [RECOMMENDED]
"no-empty-pattern": 2, // disallow empty destructuring patterns [RECOMMENDED]
"no-eq-null": 2, // disallow null comparisons without type-checking operators
"no-eval": 2, // disallow the use of eval()
"no-ex-assign": 2, // disallow reassigning exceptions in catch clauses [RECOMMENDED]
"no-extend-native": 2, // disallow extending native types
"no-extra-bind": 2, // disallow unnecessary calls to .bind() [AUTOFIX]
"no-extra-boolean-cast": 0, // disallow unnecessary boolean casts [RECOMMENDED]
"no-extra-parens": 2, // disallow unnecessary parentheses [AUTOFIX]
"no-extra-semi": 2, // disallow unnecessary semicolons [RECOMMENDED] [AUTOFIX]
"no-fallthrough": 2, // disallow fallthrough of case statements [RECOMMENDED]
"no-floating-decimal": 2, // disallow leading or trailing decimal points in numeric literals [AUTOFIX]
"no-func-assign": 2, // disallow reassigning function declarations [RECOMMENDED]
"no-global-assign": 2, // disallow assignments to native objects or read-only global variables
"no-implicit-coercion": 2, // disallow shorthand type conversions [AUTOFIX]
"no-implicit-globals": 0, // disallow variable and function declarations in the global scope
"no-implied-eval": 2, // disallow the use of eval()-like methods
"no-inline-comments": 2, // disallow inline comments after code
"no-inner-declarations": 2, // disallow variable or function declarations in nested blocks [RECOMMENDED]
"no-invalid-regexp": 2, // disallow invalid regular expression strings in RegExp constructors [RECOMMENDED]
"no-invalid-this": 0, // disallow this keywords outside of classes or class-like objects
"no-irregular-whitespace": 2, // disallow irregular whitespace outside of strings and comments [RECOMMENDED]
"no-iterator": 2, // disallow the use of the __iterator__ property
"no-label-var": 2, // disallow labels that share a name with a variable
"no-labels": 2, // disallow labeled statements
"no-lone-blocks": 2, // disallow unnecessary nested blocks
"no-lonely-if": 2, // disallow if statements as the only statement in else blocks [AUTOFIX]
"no-loop-func": 2, // disallow function declarations and expressions inside loop statements
"no-magic-numbers": 0, // disallow magic numbers
"no-mixed-requires": 0, // disallow require calls to be mixed with regular variable declarations
"no-mixed-spaces-and-tabs": 2, // disallow mixed spaces and tabs for indentation [RECOMMENDED]
"no-multi-spaces": 2, // disallow multiple spaces [AUTOFIX]
"no-multi-str": 2, // disallow multiline strings
"no-multiple-empty-lines": [ // disallow multiple empty lines [AUTOFIX]
2,
{
"max": 2
}
],
"no-native-reassign": 2, // DEPRECATED: replaced by no-global-assign
"no-negated-condition": 2, // disallow negated conditions
"no-negated-in-lhs": 2, // DEPRECATED: replaced by no-unsafe-negation
"no-nested-ternary": 2, // disallow nested ternary expressions
"no-new": 2, // disallow new operators outside of assignments or comparisons
"no-new-func": 2, // disallow new operators with the Function object
"no-new-object": 2, // disallow Object constructors
"no-new-require": 2, // disallow new operators with calls to require
"no-new-symbol": 2, // disallow new operators with the Symbol object [RECOMMENDED]
"no-new-wrappers": 2, // disallow new operators with the String, Number, and Boolean objects
"no-obj-calls": 2, // disallow calling global object properties as functions [RECOMMENDED]
"no-octal": 2, // disallow octal literals [RECOMMENDED]
"no-octal-escape": 2, // disallow octal escape sequences in string literals
"no-param-reassign": [ // disallow reassigning function parameters
2,
{
"props": false
}
],
"no-path-concat": 2, // disallow string concatenation with __dirname and __filename
"no-process-env": 2, // disallow the use of process.env
"no-process-exit": 2, // disallow the use of process.exit()
"no-proto": 2, // disallow the use of the __proto__ property
"no-redeclare": [ // disallow variable redeclaration [RECOMMENDED]
2,
{
"builtinGlobals": true
}
],
"no-regex-spaces": 2, // disallow multiple spaces in regular expressions [RECOMMENDED] [AUTOFIX]
"no-restricted-globals": 0, // disallow specified global variables
"no-restricted-modules": 0, // disallow specified modules when loaded by require
"no-restricted-properties": 0, // disallow certain properties on certain objects
"no-restricted-syntax": [ // disallow specified syntax
2,
"TemplateLiteral"
],
"no-return-assign": 2, // disallow assignment operators in return statements
"no-script-url": 2, // disallow javascript: urls
"no-self-assign": 2, // disallow assignments where both sides are exactly the same [RECOMMENDED]
"no-self-compare": 2, // disallow comparisons where both sides are exactly the same
"no-sequences": 2, // disallow comma operators
"no-shadow": [ // disallow variable declarations from shadowing variables declared in the outer scope
2,
{
"builtinGlobals": false,
"hoist": "all"
}
],
"no-shadow-restricted-names": 2, // disallow identifiers from shadowing restricted names
"no-spaced-func": 2, // DEPRECATED: replaced by func-call-spacing
"no-sparse-arrays": 2, // disallow sparse arrays [RECOMMENDED]
"no-sync": 0, // disallow synchronous methods
"no-tabs": 2, // disallow tabs in file
"no-template-curly-in-string": 2, // disallow template literal placeholder syntax in regular strings
"no-ternary": 0, // disallow ternary operators
"no-this-before-super": 2, // disallow this/super before calling super() in constructors [RECOMMENDED]
"no-throw-literal": 2, // disallow throwing literals as exceptions
"no-trailing-spaces": 2, // disallow trailing whitespace at the end of lines [AUTOFIX]
"no-undef": 2, // disallow the use of undeclared variables unless mentioned in /*global */ comments [RECOMMENDED]
"no-undef-init": 2, // disallow initializing variables to undefined [AUTOFIX]
"no-undefined": 2, // disallow the use of undefined as an identifier
"no-underscore-dangle": 0, // disallow dangling underscores in identifiers
"no-unexpected-multiline": 2, // disallow confusing multiline expressions [RECOMMENDED]
"no-unmodified-loop-condition": 2, // disallow unmodified loop conditions
"no-unneeded-ternary": 2, // disallow ternary operators when simpler alternatives exist
"no-unreachable": 1, // disallow unreachable code after return, throw, continue, and break statements [RECOMMENDED]
"no-unsafe-finally": 2, // disallow control flow statements in finally blocks [RECOMMENDED]
"no-unsafe-negation": 2, // disallow negating the left operand of relational operators [AUTOFIX]
"no-unused-expressions": 2, // disallow unused expressions
"no-unused-vars": 2, // disallow unused variables [RECOMMENDED]
"no-use-before-define": 2, // disallow the use of variables before they are defined
"no-use-extend-native/no-use-extend-native": 2, // verifies code is not using a non-native prototype
"no-useless-call": 2, // disallow unnecessary calls to .call() and .apply()
"no-useless-computed-key": 2, // disallow unnecessary computed property keys in object literals [AUTOFIX]
"no-useless-concat": 2, // disallow unnecessary concatenation of literals or template literals
"no-useless-constructor": 2, // disallow unnecessary constructors
"no-useless-escape": 2, // disallow unnecessary escape characters
"no-useless-rename": [ // disallow renaming import, export, and destructured assignments to the same name [AUTOFIX]
2,
{
"ignoreDestructuring": false,
"ignoreExport": false,
"ignoreImport": false
}
],
"no-var": 2, // require let or const instead of var [AUTOFIX]
"no-void": 2, // disallow void operators
"no-warning-comments": [ // disallow specified warning terms in comments
1,
{
"location": "start",
"terms": [
"todo",
"@toto"
]
}
],
"no-whitespace-before-property": 2, // disallow whitespace before properties [AUTOFIX]
"no-with": 2, // disallow with statements
"object-curly-spacing": [ // enforce consistent spacing inside braces [AUTOFIX]
0,
"never"
],
"object-property-newline": [ // enforce placing object properties on separate lines
2,
{
"allowMultiplePropertiesPerLine": false
}
],
"object-shorthand": [ // require or disallow method and property shorthand syntax for object literals [AUTOFIX]
0,
"always"
],
"one-var": 0, // enforce variables to be declared either together or separately in functions
"one-var-declaration-per-line": 2, // require or disallow newlines around variable declarations [AUTOFIX]
"operator-assignment": [ // require or disallow assignment operator shorthand where possible
2,
"always"
],
"operator-linebreak": [ // enforce consistent linebreak style for operators
2,
"after"
],
"padded-blocks": [ // require or disallow padding within blocks [AUTOFIX]
2,
"never"
],
"prefer-arrow-callback": 2, // require arrow functions as callbacks [AUTOFIX]
"prefer-const": 2, // require const declarations for variables that are never reassigned after declared [AUTOFIX]
"prefer-numeric-literals": 2, // disallow parseInt() in favor of binary, octal, and hexadecimal literals [AUTOFIX]
"prefer-reflect": 0, // require Reflect methods where applicable
"prefer-rest-params": 2, // require rest parameters instead of arguments
"prefer-spread": 2, // require spread operators instead of .apply() [AUTOFIX]
"prefer-template": 0, // require template literals instead of string concatenation [AUTOFIX]
"promise/always-return": 2, // Return inside each then to create readable and reusable Promise chains.
"promise/catch-or-return": 2, // Enforces the use of catch on un-returned promises.
"promise/no-native": 1, // In an ES5 environment, make sure to create a Promise constructor before using.
"promise/param-names": 2, // Enforce consistent param names when creating new promises.
"quote-props": [ // require quotes around object literal property names [AUTOFIX]
2,
"as-needed"
],
"quotes": [ // enforce the consistent use of either backticks, double, or single quotes [AUTOFIX]
2,
"single"
],
"radix": 2, // enforce the consistent use of the radix argument when using parseInt()
"react/display-name": 0, // Prevent missing displayName in a React component definition [RECOMMENDED]
"react/forbid-component-props": 2, // Forbid certain props on Components
"react/forbid-prop-types": 0, // Forbid certain propTypes
"react/jsx-boolean-value": [ // Enforce boolean attributes notation in JSX [AUTOFIX]
2,
"always"
],
"react/jsx-closing-bracket-location": 0, // Validate closing bracket location in JSX [AUTOFIX]
"react/jsx-curly-spacing": [ // Enforce or disallow spaces inside of curly braces in JSX attributes [AUTOFIX]
2,
"never",
{
"allowMultiline": true
}
],
"react/jsx-equals-spacing": [ // Enforce or disallow spaces around equal signs in JSX attributes [AUTOFIX]
2,
"never"
],
"react/jsx-first-prop-new-line": [ // Enforce position of the first prop in JSX
2,
"multiline"
],
"react/jsx-handler-names": [ // Enforce event handler naming conventions in JSX
2,
{
"eventHandlerPrefix": "handle",
"eventHandlerPropPrefix": "on"
}
],
"react/jsx-indent": [ // Validate JSX indentation
2,
2
],
"react/jsx-indent-props": [ // Validate props indentation in JSX [AUTOFIX]
2,
2
],
"react/jsx-key": 2, // Validate JSX has key prop when in array or iterator
"react/jsx-max-props-per-line": [ // Limit maximum of props on a single line in JSX
2,
{
"maximum": 3
}
],
"react/jsx-no-bind": [ // Prevent usage of .bind() and arrow functions in JSX props
2,
{
"allowArrowFunctions": false,
"allowBind": false,
"ignoreRefs": true
}
],
"react/jsx-no-comment-textnodes": 2, // Prevent comments from being inserted as text nodes
"react/jsx-no-duplicate-props": 2, // Prevent duplicate props in JSX [RECOMMENDED]
"react/jsx-no-literals": 0, // Prevent usage of unwrapped JSX strings
"react/jsx-no-target-blank": 2, // Prevent usage of unsafe target='_blank'
"react/jsx-no-undef": 2, // Disallow undeclared variables in JSX [RECOMMENDED]
"react/jsx-pascal-case": 2, // Enforce PascalCase for user-defined JSX components
"react/jsx-sort-props": 2, // Enforce props alphabetical sorting
"react/jsx-space-before-closing": [ // Validate spacing before closing bracket in JSX [AUTOFIX]
2,
"always"
],
"react/jsx-uses-react": 1, // Prevent React to be incorrectly marked as unused [RECOMMENDED]
"react/jsx-uses-vars": 1, // Prevent variables used in JSX to be incorrectly marked as unused [RECOMMENDED]
"react/jsx-wrap-multilines": 0, // Prevent missing parentheses around multilines JSX [AUTOFIX]
"react/no-danger": 2, // Prevent usage of dangerous JSX properties
"react/no-danger-with-children": 2, // Prevent problem with children and props.dangerouslySetInnerHTML
"react/no-deprecated": 2, // Prevent usage of deprecated methods [RECOMMENDED]
"react/no-did-mount-set-state": 2, // Prevent usage of setState in componentDidMount
"react/no-did-update-set-state": 2, // Prevent usage of setState in componentDidUpdate
"react/no-direct-mutation-state": 2, // Prevent direct mutation of this.state [RECOMMENDED]
"react/no-find-dom-node": 2, // Prevent usage of findDOMNode [RECOMMENDED]
"react/no-is-mounted": 2, // Prevent usage of isMounted [RECOMMENDED]
"react/no-multi-comp": 2, // Prevent multiple component definition per file
"react/no-set-state": 2, // Prevent usage of setState
"react/no-string-refs": 2, // Prevent using string references in ref attribute.
"react/no-unknown-property": 2, // Prevent usage of unknown DOM property [RECOMMENDED] [AUTOFIX]
"react/no-unused-prop-types": 2, // Prevent definitions of unused prop types
"react/prefer-es6-class": 2,
"react/prefer-stateless-function": 2, // Enforce stateless React Components to be written as a pure function
"react/prop-types": 2, // Prevent missing props validation in a React component definition [RECOMMENDED]
"react/react-in-jsx-scope": 2, // Prevent missing React when using JSX [RECOMMENDED]
"react/require-render-return": 2, // Enforce ES5 or ES6 class for returning value in render function [RECOMMENDED]
"react/self-closing-comp": 2, // Prevent extra closing tags for components without children [AUTOFIX]
"react/sort-comp": 2, // Enforce component methods order
"react/sort-prop-types": 2, // Enforce propTypes declarations alphabetical sorting
"react/style-prop-object": 2, // Enforce style prop value being an object
"require-jsdoc": 0, // require JSDoc comments
"require-yield": 2, // require generator functions to contain yield [RECOMMENDED]
"semi": [ // require or disallow semicolons instead of ASI [AUTOFIX]
2,
"always"
],
"semi-spacing": [ // enforce consistent spacing before and after semicolons [AUTOFIX]
2,
{
"after": true,
"before": false
}
],
"sort-keys": [ // require object keys to be sorted
2,
"asc",
{
"caseSensitive": false,
"natural": true
}
],
"sort-vars": 2, // require variables within the same declaration block to be sorted
"space-before-blocks": [ // enforce consistent spacing before blocks [AUTOFIX]
2,
"always"
],
"space-before-function-paren": [ // enforce consistent spacing before function definition opening parenthesis [AUTOFIX]
2,
"always"
],
"space-in-parens": [ // enforce consistent spacing inside parentheses [AUTOFIX]
2,
"never"
],
"space-infix-ops": 2, // require spacing around infix operators [AUTOFIX]
"space-unary-ops": [ // enforce consistent spacing before or after unary operators [AUTOFIX]
2,
{
"nonwords": false,
"words": true
}
],
"spaced-comment": [ // enforce consistent spacing after the // or /* in a comment [AUTOFIX]
2,
"always"
],
"strict": [ // require or disallow strict mode directives [AUTOFIX]
2,
"never"
],
"symbol-description": 2, // require symbol descriptions
"unicode-bom": [ // require or disallow Unicode byte order mark (BOM) [AUTOFIX]
2,
"never"
],
"use-isnan": 2, // require calls to isNaN() when checking for NaN [RECOMMENDED]
"valid-jsdoc": 0, // enforce valid JSDoc comments
"valid-typeof": 2, // enforce comparing typeof expressions against valid strings [RECOMMENDED]
"vars-on-top": 2, // require var declarations be placed at the top of their containing scope
"wrap-iife": [ // require parentheses around immediate function invocations [AUTOFIX]
2,
"inside"
],
"wrap-regex": 0, // require parenthesis around regex literals [AUTOFIX]
"yoda": 0 // require or disallow “Yoda” conditions [AUTOFIX]
},
"settings": {
"import/extensions": [ // Ensure consistent use of file extension within the import path
".js"
],
"import/ignore": [
"node_modules"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment