Skip to content

Commit

Permalink
Bump eslint plugins (#179)
Browse files Browse the repository at this point in the history
Preps for the latest major version of TS tooling, and sets the stage for
ESLint 7 updates, supporting optional-chaining

Major bumps are:

- @typescript-eslint/eslint-plugin to 4.1.0
- eslint-plugin-graphql to 4.0.0
- eslint-plugin-jest to 24.0.0
  • Loading branch information
BPScott committed Sep 11, 2020
1 parent 4fdd8dc commit c8035b0
Show file tree
Hide file tree
Showing 5 changed files with 596 additions and 329 deletions.
10 changes: 7 additions & 3 deletions packages/eslint-plugin/lib/config/rules/jest.js
Expand Up @@ -13,6 +13,8 @@ module.exports = {
'jest/no-jasmine-globals': 'error',
// Limited snapshot sizes to keep snapshops manageable and reviewable.
'jest/no-large-snapshots': ['error', {maxSize: 12}],
// Disallow interpolation in snapshots to ensure they can be automatically updated.
'jest/no-interpolation-in-snapshots': 'error',
// For better failure messages, use `toHaveLength()` to on object lengths.
'jest/prefer-to-have-length': 'error',
// Suggest using toMatchInlineSnapshot()
Expand Down Expand Up @@ -44,7 +46,7 @@ module.exports = {
// Disallow setup and teardown hooks
'jest/no-hooks': 'off',
// Using a callback in asynchronous tests
'jest/no-test-callback': 'error',
'jest/no-done-callback': 'error',
// Disallow using toBeTruthy() & toBeFalsy()
'jest/no-truthy-falsy': 'error',
// Suggest using toBeCalledWith() OR toHaveBeenCalledWith()
Expand All @@ -67,8 +69,8 @@ module.exports = {
'jest/no-duplicate-hooks': 'error',
// Disallow conditional logic
'jest/no-if': 'error',
// Prevent assertions in catch blocks.
'jest/no-try-expect': 'error',
// Prevent assertions that are conditional.
'jest/no-conditional-expect': 'error',
// Disallow export from test files
'jest/no-export': 'error',
// Prevents `expect` statements outside of a `test` or `it` block
Expand All @@ -81,4 +83,6 @@ module.exports = {
'jest/prefer-hooks-on-top': 'error',
// Require top-level describe block
'jest/require-top-level-describe': 'error',
// Avoid using deprecated functions
'jest/no-deprecated-functions': 'error',
};
2 changes: 1 addition & 1 deletion packages/eslint-plugin/lib/config/rules/typescript.js
Expand Up @@ -156,7 +156,7 @@ module.exports = {
'@typescript-eslint/prefer-function-type': 'off',
// Functions that return promises must be async
'@typescript-eslint/promise-function-async': 'off',
// Bans “// @ts-ignore” comments from being used
// Bans “// @ts-ignore” comments from being used. "@ts-expect-error: some comment describing why it's disabled" is allowed
'@typescript-eslint/ban-ts-comment': 'error',
// Enforce consistent brace style for blocks
'@typescript-eslint/brace-style': 'error',
Expand Down
Expand Up @@ -34,10 +34,7 @@ module.exports = {
// When adding two variables, operands must both be of type number or of type string
'@typescript-eslint/restrict-plus-operands': 'error',
// Prevents conditionals where the type is always truthy or always falsy
'@typescript-eslint/no-unnecessary-condition': [
'error',
{ignoreRhs: true},
],
'@typescript-eslint/no-unnecessary-condition': ['error'],
// Warns if an explicitly specified type argument is the default for that type parameter
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
// Requires that private members are marked as readonly if they're never modified outside of the constructor
Expand Down
24 changes: 12 additions & 12 deletions packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@shopify/eslint-plugin",
"version": "38.0.0",
"version": "38.1.0-beta.3",
"license": "MIT",
"description": "Shopify’s ESLint rules and configs.",
"keywords": [
Expand Down Expand Up @@ -33,26 +33,26 @@
"eslint": "^6.0.0"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"babel-eslint": "10.1.0",
"change-case": "^4.1.1",
"common-tags": "^1.8.0",
"eslint-config-prettier": "6.11.0",
"eslint-module-utils": "2.6.0",
"eslint-plugin-babel": "5.3.0",
"eslint-plugin-eslint-comments": "3.1.2",
"eslint-plugin-graphql": "3.1.1",
"eslint-plugin-babel": "5.3.1",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-graphql": "4.0.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.13.0",
"eslint-plugin-jest": "24.0.0",
"eslint-plugin-jest-formatting": "2.0.0",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-jsx-a11y": "6.3.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "3.1.3",
"eslint-plugin-prettier": "3.1.4",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-react": "7.20.0",
"eslint-plugin-react-hooks": "4.0.2",
"eslint-plugin-sort-class-members": "1.7.0",
"eslint-plugin-react": "7.20.6",
"eslint-plugin-react-hooks": "4.1.1",
"eslint-plugin-sort-class-members": "1.8.0",
"merge": "^1.2.1",
"pkg-dir": "^4.2.0",
"pluralize": "^8.0.0"
Expand Down

0 comments on commit c8035b0

Please sign in to comment.