Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Replace all warns with errors #48

Merged
merged 2 commits into from
Oct 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
## [Unreleased]

### Changed
* Replace all `warn` with `error`
* `space-before-function-paren` now uses `asyncArrow` option (eg. `async () => {}`)
* `lines-around-directive` was deprecated in ESLint `v4.0.0`.
* Enable `padding-line-between-statements` for directives

## [17.1.0] - 2017-09-19

### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/config/esnext.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
require('./rules/import'),
{
// default params
'no-param-reassign': 'warn',
'no-param-reassign': 'error',
// Rules override by the Babel plugin
'new-cap': 'off',
'no-await-in-loop': 'off',
Expand Down
2 changes: 1 addition & 1 deletion lib/config/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module.exports = {
],

rules: {
'shopify/jquery-dollar-sign-reference': 'warn',
'shopify/jquery-dollar-sign-reference': 'error',
},
};
2 changes: 1 addition & 1 deletion lib/config/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
require('./rules/mocha'),
require('./rules/chai-expect'),
{
'shopify/sinon-prefer-meaningful-assertions': 'warn',
'shopify/sinon-prefer-meaningful-assertions': 'error',
// Chai expect syntax produces unused expression warnings
'no-unused-expressions': 'off',
// Chai expect syntax can have long chained calls
Expand Down
2 changes: 1 addition & 1 deletion lib/config/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
require('./rules/jsx-a11y'),
{
// Not using `this` is fine in some lifecycle hooks
'class-methods-use-this': ['warn', {
'class-methods-use-this': ['error', {
exceptMethods: [
'render',
'getChildContext',
Expand Down
20 changes: 10 additions & 10 deletions lib/config/rules/ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module.exports = {
// Enforce passing correct arguments to assertions.
'ava/assertion-arguments': 'error',
// Limit the number of assertions in a test.
'ava/max-asserts': ['warn', 5],
'ava/max-asserts': ['error', 5],
// Ensure no test.cb() is used.
'ava/no-cb-test': 'warn',
'ava/no-cb-test': 'error',
// Ensure that async tests use await
'ava/no-async-fn-without-await': 'off',
// Ensure tests do not have duplicate modifiers.
Expand All @@ -18,23 +18,23 @@ module.exports = {
// Ensure t.end() is only called inside test.cb().
'ava/no-invalid-end': 'error',
// Ensure no test.only() are present.
'ava/no-only-test': 'warn',
'ava/no-only-test': 'error',
// Ensure no tests are nested.
'ava/no-nested-tests': 'warn',
'ava/no-nested-tests': 'error',
// Ensure no assertions are skipped.
'ava/no-skip-assert': 'error',
// Ensure no tests are skipped.
'ava/no-skip-test': 'error',
// Ensure t.end() is the last statement executed.
'ava/no-statement-after-end': 'error',
// Ensure test.todo() is not given an implementation function.
'ava/no-todo-implementation': 'warn',
'ava/no-todo-implementation': 'error',
// Ensure no test.todo() is used.
'ava/no-todo-test': 'warn',
'ava/no-todo-test': 'error',
// Prevent the use of unknown test modifiers.
'ava/no-unknown-modifiers': 'error',
// Prefer using async/await instead of returning a Promise.
'ava/prefer-async-await': 'warn',
'ava/prefer-async-await': 'error',
// Allow only use of the asserts that have no power-assert alternative.
'ava/prefer-power-assert': 'off',
// Ensure callback tests are explicitly ended.
Expand All @@ -44,9 +44,9 @@ module.exports = {
// Prevent the incorrect use of t.
'ava/use-t-well': 'error',
// Ensure test functions use t as their parameter.
'ava/use-t': 'warn',
'ava/use-t': 'error',
// Ensure that AVA is imported with test as the variable name.
'ava/use-test': 'warn',
'ava/use-test': 'error',
// Ensure that t.true()/t.false() are used instead of t.truthy()/t.falsy().
'ava/use-true-false': 'warn',
'ava/use-true-false': 'error',
};
2 changes: 1 addition & 1 deletion lib/config/rules/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
// Ignores capitalized decorators (@Decorator)
'babel/new-cap': ['error', {newIsCap: true, capIsNew: false}],
// doesn't complain about export x from "mod"; or export * as x from "mod";
'babel/object-curly-spacing': ['warn', 'never'],
'babel/object-curly-spacing': ['error', 'never'],
// doesn't fail when inside class properties
'babel/no-invalid-this': 'error',
// Rule to flag missing semicolons
Expand Down
50 changes: 25 additions & 25 deletions lib/config/rules/best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ module.exports = {
// Enforces return statements in callbacks of array's methods
'array-callback-return': 'error',
// Treat var statements as if they were block scoped
'block-scoped-var': 'warn',
'block-scoped-var': 'error',
// Enforce that class methods utilize this
'class-methods-use-this': 'warn',
'class-methods-use-this': 'error',
// Specify the maximum cyclomatic complexity allowed in a program
'complexity': 'off',
// Require return statements to either always or never specify values
'consistent-return': 'warn',
'consistent-return': 'error',
// Specify curly brace conventions for all control statements
'curly': ['warn', 'all'],
'curly': ['error', 'all'],
// Require default case in switch statements
'default-case': 'off',
// Encourages use of dot notation whenever possible
'dot-notation': ['warn', {allowKeywords: true}],
'dot-notation': ['error', {allowKeywords: true}],
// Enforces consistent newlines before or after dots
'dot-location': ['warn', 'property'],
'dot-location': ['error', 'property'],
// Require the use of === and !==
'eqeqeq': ['error', 'allow-null'],
// Make sure for-in loops have an if statement
'guard-for-in': 'warn',
'guard-for-in': 'error',
// Disallow the use of alert, confirm, and prompt
'no-alert': 'warn',
'no-alert': 'error',
// disallow lexical declarations in case clauses
'no-case-declarations': 'error',
// Disallow use of arguments.caller or arguments.callee
'no-caller': 'error',
// Disallow division operators explicitly at beginning of regular expression
'no-div-regex': 'warn',
'no-div-regex': 'error',
// Disallow else after a return in an if
'no-else-return': 'off',
// Disallow use of empty functions
'no-empty-function': 'warn',
'no-empty-function': 'error',
// Disallow use of empty destructuring patterns
'no-empty-pattern': 'error',
// Disallow comparisons to null without a type-checking operator
Expand All @@ -46,19 +46,19 @@ module.exports = {
// Disallow adding to native types
'no-extend-native': 'error',
// Disallow unnecessary function binding
'no-extra-bind': 'warn',
'no-extra-bind': 'error',
// Disallow unnecessary labels
'no-extra-label': 'error',
// Disallow fallthrough of case statements
'no-fallthrough': 'error',
// Disallow the use of leading or trailing decimal points in numeric literals
'no-floating-decimal': 'warn',
'no-floating-decimal': 'error',
// Disallow reassignments of native objects
'no-global-assign': 'error',
// Disallow the type conversions with shorter notations
'no-implicit-coercion': 'warn',
'no-implicit-coercion': 'error',
// Disallow var and named functions in global scope
'no-implicit-globals': 'warn',
'no-implicit-globals': 'error',
// Disallow use of eval()-like methods
'no-implied-eval': 'error',
// Disallow this keywords outside of classes or class-like objects
Expand All @@ -68,26 +68,26 @@ module.exports = {
// Disallow use of labeled statements
'no-labels': 'error',
// Disallow unnecessary nested blocks
'no-lone-blocks': 'warn',
'no-lone-blocks': 'error',
// Disallow creation of functions within loops
'no-loop-func': 'error',
// Disallow the use of magic numbers
'no-magic-numbers': 'off',
// Disallow use of multiple spaces
'no-multi-spaces': 'warn',
'no-multi-spaces': 'error',
// Disallow use of multiline strings
'no-multi-str': 'off',
// Disallow use of new operator for Function object
'no-new-func': 'error',
// Disallows creating new instances of String, Number, and Boolean
'no-new-wrappers': 'error',
// Disallow use of new operator when not part of the assignment or comparison
'no-new': 'warn',
'no-new': 'error',
// Disallow use of octal escape sequences in string literals,
// such as var foo = "Copyright \251";
'no-octal-escape': 'error',
// Disallow use of octal literals
'no-octal': 'warn',
'no-octal': 'error',
// Allow reassignment of function parameters
'no-param-reassign': 'off',
// Disallow use of process.env
Expand All @@ -109,27 +109,27 @@ module.exports = {
// Disallow comparisons where both sides are exactly the same
'no-self-compare': 'error',
// Disallow use of comma operator
'no-sequences': 'warn',
'no-sequences': 'error',
// Restrict what can be thrown as an exception
'no-throw-literal': 'warn',
'no-throw-literal': 'error',
// Disallow unmodified conditions of loops
'no-unmodified-loop-condition': 'error',
// Disallow usage of expressions in statement position
'no-unused-expressions': 'warn',
'no-unused-expressions': 'error',
// Disallow unused labels
'no-unused-labels': 'error',
// Disallow unnecessary .call() and .apply()
'no-useless-call': 'error',
// Disallow unnecessary concatenation of literals or template literals
'no-useless-concat': 'warn',
'no-useless-concat': 'error',
// Disallow unnecessary usage of escape character
'no-useless-escape': 'error',
// Disallow redundant return statements
'no-useless-return': 'error',
// Disallow use of void operator
'no-void': 'error',
// Disallow usage of configurable warning terms in comments
'no-warning-comments': 'warn',
'no-warning-comments': 'error',
// Disallow use of the with statement
'no-with': 'error',
// Require using Error objects as Promise rejection reasons
Expand All @@ -141,7 +141,7 @@ module.exports = {
// Requires to declare all vars on top of their containing scope
'vars-on-top': 'off',
// Require immediate function invocation to be wrapped in parentheses
'wrap-iife': ['warn', 'inside'],
'wrap-iife': ['error', 'inside'],
// Require or disallow Yoda conditions
'yoda': ['warn', 'never'],
'yoda': ['error', 'never'],
};
2 changes: 1 addition & 1 deletion lib/config/rules/chai-expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
// Prevent using comparisons in the expect() argument.
'chai-expect/no-inner-compare': 'warn',
'chai-expect/no-inner-compare': 'error',
// Prevent calling expect(...) without an assertion like .to.be.ok.
'chai-expect/missing-assertion': 'error',
// Prevent calling to.be.ok and other assertion properties as functions.
Expand Down
24 changes: 12 additions & 12 deletions lib/config/rules/ecmascript-6.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ module.exports = {
// Require braces in arrow function body
'arrow-body-style': 'off',
// Require parens in arrow function arguments
'arrow-parens': ['warn', 'always'],
'arrow-parens': ['error', 'always'],
// Require space before/after arrow function's arrow
'arrow-spacing': ['warn', {before: true, after: true}],
'arrow-spacing': ['error', {before: true, after: true}],
// Verify super() callings in constructors
'constructor-super': 'error',
// Enforce the spacing around the * in generator functions
'generator-star-spacing': ['warn', 'after'],
'generator-star-spacing': ['error', 'after'],
// Disallow modifying variables of class declarations
'no-class-assign': 'warn',
'no-class-assign': 'error',
// Disallow arrow functions where they could be confused with comparisons
'no-confusing-arrow': ['error', {allowParens: true}],
// Disallow modifying variables that are declared using const
Expand All @@ -28,17 +28,17 @@ module.exports = {
// Disallow unnecessary computed property keys in object literals
'no-useless-computed-key': 'off',
// Disallow unnecessary constructor
'no-useless-constructor': 'warn',
'no-useless-constructor': 'error',
// Disallow renaming import, export, and destructured assignments to the same name
'no-useless-rename': 'error',
// Require let or const instead of var
'no-var': 'error',
// Require method and property shorthand syntax for object literals
'object-shorthand': ['warn', 'always', {avoidQuotes: true}],
'object-shorthand': ['error', 'always', {avoidQuotes: true}],
// Suggest using arrow functions as callbacks
'prefer-arrow-callback': ['error', {allowNamedFunctions: true}],
// Suggest using of const declaration for variables that are never modified after declared
'prefer-const': 'warn',
'prefer-const': 'error',
// Require destructuring from arrays and/or objects
'prefer-destructuring': 'off',
// Disallow parseInt() in favor of binary, octal, and hexadecimal literals
Expand All @@ -50,17 +50,17 @@ module.exports = {
// Suggest using Reflect methods where applicable
'prefer-reflect': 'off',
// Suggest using template literals instead of strings concatenation
'prefer-template': 'warn',
'prefer-template': 'error',
// Enforce spacing between rest and spread operators and their expressions
'rest-spread-spacing': ['warn', 'never'],
'rest-spread-spacing': ['error', 'never'],
// Disallow generator functions that do not have yield
'require-yield': 'error',
// Sort import declarations within module
'sort-imports': 'off',
// Require symbol descriptions
'symbol-description': 'warn',
'symbol-description': 'error',
// Enforce spacing around embedded expressions of template strings
'template-curly-spacing': ['warn', 'never'],
'template-curly-spacing': ['error', 'never'],
// Enforce spacing around the * in yield* expressions
'yield-star-spacing': ['warn', {before: false, after: true}],
'yield-star-spacing': ['error', {before: false, after: true}],
};
20 changes: 10 additions & 10 deletions lib/config/rules/flowtype.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

module.exports = {
// Enforces a particular style for boolean type annotations.
'flowtype/boolean-style': ['warn', 'boolean'],
'flowtype/boolean-style': ['error', 'boolean'],
// Marks Flow type identifiers as defined.
'flowtype/define-flow-type': 'error',
// Enforces consistent use of trailing commas in Object and Tuple annotations.
'flowtype/delimiter-dangle': ['warn', 'always-multiline'],
'flowtype/delimiter-dangle': ['error', 'always-multiline'],
// Enforces consistent spacing within generic type annotation parameters.
'flowtype/generic-spacing': ['warn', 'never'],
'flowtype/generic-spacing': ['error', 'never'],
// Checks for duplicate properties in Object annotations
'flowtype/no-dupe-keys': 'error',
// Disallows use of primitive constructors as types, such as Boolean, Number and String.
Expand All @@ -22,29 +22,29 @@ module.exports = {
Function: true,
}],
// Enforces consistent separators between properties in Flow object types.
'flowtype/object-type-delimiter': ['warn', 'comma'],
'flowtype/object-type-delimiter': ['error', 'comma'],
// Requires that all function parameters have type annotations.
'flowtype/require-parameter-type': 'off',
// Requires that functions have return type annotation.
'flowtype/require-return-type': 'off',
// Makes sure that files have a valid @flow annotation.
'flowtype/require-valid-file-annotation': ['warn', 'always'],
'flowtype/require-valid-file-annotation': ['error', 'always'],
// Requires that all variable declarators have type annotations.
'flowtype/require-variable-type': 'off',
// Enforces consistent use of semicolons after type aliases.
'flowtype/semi': ['warn', 'always'],
'flowtype/semi': ['error', 'always'],
// Enforces sorting of Object annotations
'flowtype/sort-keys': 'off',
// Enforces consistent spacing after the type annotation colon.
'flowtype/space-after-type-colon': ['warn', 'always'],
'flowtype/space-after-type-colon': ['error', 'always'],
// Enforces consistent spacing before the type annotation colon.
'flowtype/space-before-type-colon': ['warn', 'never'],
'flowtype/space-before-type-colon': ['error', 'never'],
// Enforces consistent spacing before the opening < of generic type annotation parameters.
'flowtype/space-before-generic-bracket': ['warn', 'never'],
'flowtype/space-before-generic-bracket': ['error', 'never'],
// Enforces a consistent naming pattern for type aliases.
'flowtype/type-id-match': 'off',
// Enforces consistent spacing around union and intersection type separators (| and &).
'flowtype/union-intersection-spacing': 'warn',
'flowtype/union-intersection-spacing': 'error',
// Marks Flow type alias declarations as used.
'flowtype/use-flow-type': 'error',
// Checks for simple Flow syntax errors.
Expand Down
Loading