Skip to content

Commit

Permalink
breaking: Migrate warnings to errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Feb 26, 2020
1 parent c2f1668 commit cb0b6cd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
24 changes: 12 additions & 12 deletions packages/config-eslint/src/presets/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,32 @@ const config: ESLintConfig = {

// JEST
'jest/expect-expect': 'error',
'jest/no-alias-methods': 'warn',
'jest/no-alias-methods': 'error',
'jest/no-disabled-tests': 'error',
'jest/no-duplicate-hooks': 'warn',
'jest/no-expect-resolves': 'warn',
'jest/no-duplicate-hooks': 'error',
'jest/no-expect-resolves': 'error',
'jest/no-export': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/no-if': 'error',
'jest/no-jasmine-globals': 'warn',
'jest/no-jasmine-globals': 'error',
'jest/no-jest-import': 'error',
'jest/no-standalone-expect': 'error',
'jest/no-test-callback': 'error',
'jest/no-test-prefixes': 'warn',
'jest/no-test-return-statement': 'warn',
'jest/prefer-hooks-on-top': 'warn',
'jest/prefer-spy-on': 'warn',
'jest/no-test-prefixes': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-hooks-on-top': 'error',
'jest/prefer-spy-on': 'error',
'jest/prefer-todo': 'error',
'jest/prefer-to-be-null': 'error',
'jest/prefer-to-be-undefined': 'error',
'jest/prefer-to-contain': 'warn',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'jest/require-to-throw-message': 'warn',
'jest/require-to-throw-message': 'error',
'jest/require-top-level-describe': 'error',
'jest/valid-describe': 'warn',
'jest/valid-describe': 'error',
'jest/valid-expect': 'error',
'jest/valid-title': 'warn',
'jest/valid-title': 'error',
},
},
],
Expand Down
28 changes: 14 additions & 14 deletions packages/config-eslint/src/presets/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config: ESLintConfig = {

rules: {
// Not enabled in Airbnb
'default-param-last': 'warn',
'default-param-last': 'error',
'func-name-matching': [
'error',
'always',
Expand All @@ -19,17 +19,17 @@ const config: ESLintConfig = {
'multiline-comment-style': 'off',
'multiline-ternary': ['error', 'never'],
'no-constant-condition': 'error',
'no-constructor-return': 'warn',
'no-constructor-return': 'error',
'no-div-regex': 'error',
'no-dupe-else-if': 'warn',
'no-dupe-else-if': 'error',
'no-implicit-coercion': 'error',
'no-import-assign': 'warn',
'no-import-assign': 'error',
'no-native-reassign': 'error',
'no-negated-condition': 'error',
'no-setter-return': 'warn',
'no-setter-return': 'error',
'no-useless-call': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-regex-literals': 'warn',
'prefer-regex-literals': 'error',
'require-atomic-updates': 'error',

// Replaced with new proposals
Expand Down Expand Up @@ -64,8 +64,8 @@ const config: ESLintConfig = {
],
'react/jsx-key': 'error',
'react/jsx-no-literals': 'error',
'react/jsx-no-useless-fragment': 'warn',
'react/jsx-no-script-url': 'warn',
'react/jsx-no-useless-fragment': 'error',
'react/jsx-no-script-url': 'error',
'react/jsx-sort-default-props': [
'error',
{
Expand Down Expand Up @@ -135,7 +135,7 @@ const config: ESLintConfig = {

// UNICORN
'unicorn/catch-error-name': 'error',
'unicorn/consistent-function-scoping': 'warn',
'unicorn/consistent-function-scoping': 'error',
'unicorn/custom-error-definition': 'error',
'unicorn/error-message': 'error',
'unicorn/escape-case': 'error',
Expand All @@ -153,19 +153,19 @@ const config: ESLintConfig = {
'unicorn/no-zero-fractions': 'error',
'unicorn/number-literal-case': 'error',
'unicorn/prefer-add-event-listener': 'error',
'unicorn/prefer-dataset': 'warn',
'unicorn/prefer-dataset': 'error',
'unicorn/prefer-event-key': 'error',
'unicorn/prefer-flat-map': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/prefer-modern-dom-apis': 'warn',
'unicorn/prefer-negative-index': 'warn',
'unicorn/prefer-modern-dom-apis': 'error',
'unicorn/prefer-negative-index': 'error',
'unicorn/prefer-node-append': 'error',
'unicorn/prefer-node-remove': 'error',
'unicorn/prefer-starts-ends-with': 'error',
'unicorn/prefer-string-slice': 'warn',
'unicorn/prefer-string-slice': 'error',
'unicorn/prefer-spread': 'off', // Currently broken
'unicorn/prefer-text-content': 'error',
'unicorn/prefer-trim-start-end': 'warn',
'unicorn/prefer-trim-start-end': 'error',
'unicorn/prefer-type-error': 'error',
'unicorn/regex-shorthand': 'error',
'unicorn/throw-new-error': 'error',
Expand Down
16 changes: 8 additions & 8 deletions packages/config-eslint/src/presets/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,30 +90,30 @@ const config: ESLintConfig = {
'@typescript-eslint/no-empty-function': 'off', // Default props are usually empty
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': [
'warn',
'error',
{ fixToUnknown: true, ignoreRestArgs: true },
],
'@typescript-eslint/no-extra-parens': 'warn',
'@typescript-eslint/no-extra-parens': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-parameter-properties': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-throw-literal': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/no-throw-literal': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unused-vars': ['error', noUnused],
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/prefer-as-const': 'warn',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'off', // Lots of false positives
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/promise-function-async': 'off', // Conflicts with other async rules
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unified-signatures': 'warn',
'@typescript-eslint/unified-signatures': 'error',
},
},
],
Expand Down

0 comments on commit cb0b6cd

Please sign in to comment.