├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── README.md ├── images └── sample-transform.png ├── package.json ├── src ├── format.ts ├── transform.ts └── transforms │ ├── __testfixtures__ │ ├── jest-no-manual-cleanup │ │ ├── cleanup-as-argument.input.ts │ │ ├── keep-lifecycle-method.input.ts │ │ ├── remove-cleanup-call.input.ts │ │ └── remove-lifecycle-method.input.ts │ ├── jest-prefer-presence-queries │ │ ├── falsy-queries.input.tsx │ │ └── truthy-queries.input.tsx │ └── jest-prefer-screen-queries │ │ ├── destructure-and-unused-global-var.input.tsx │ │ ├── destructure-and-unused-local-var.input.tsx │ │ ├── empty-destructure.input.tsx │ │ ├── insert-import-after-react.input.tsx │ │ ├── keep-object-props.input.tsx │ │ ├── keep-other-imports.input.tsx │ │ ├── keep-query-options.input.tsx │ │ ├── keep-referenced-vars.input.tsx │ │ ├── named-destructure.input.tsx │ │ ├── named-imports.input.tsx │ │ ├── non-empty-destructure.input.tsx │ │ ├── query-within.input.tsx │ │ ├── replace-member-expressions.input.tsx │ │ ├── respect-shadowed-vars.input.tsx │ │ ├── reuse-existing-import.input.tsx │ │ └── screen-and-within.input.tsx │ ├── __tests__ │ ├── __snapshots__ │ │ ├── jest-no-manual-cleanup.test.ts.snap │ │ ├── jest-prefer-presence-queries.test.ts.snap │ │ └── jest-prefer-screen-queries.test.ts.snap │ ├── jest-no-manual-cleanup.test.ts │ ├── jest-prefer-presence-queries.test.ts │ └── jest-prefer-screen-queries.test.ts │ ├── no-manual-cleanup.ts │ ├── prefer-presence-queries.ts │ ├── prefer-screen-queries.ts │ └── utils │ ├── index.ts │ └── testUtils.ts ├── tsconfig.json └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | /.history/ 2 | /node_modules/ 3 | **/__testfixtures__/* 4 | /samples/ -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "plugins": [ 5 | "@typescript-eslint" 6 | ], 7 | "extends": [ 8 | "eslint:recommended", 9 | "plugin:@typescript-eslint/recommended" 10 | ], 11 | "rules": { 12 | "quotes": [ 13 | "error", 14 | "single", 15 | { 16 | "avoidEscape": true 17 | } 18 | ], 19 | "semi": ["error", "never"], 20 | "max-len": ["error", 100], 21 | "no-trailing-spaces": "error", 22 | "comma-dangle": [ 23 | "error", 24 | { 25 | "arrays": "always-multiline", 26 | "objects": "always-multiline", 27 | "imports": "always-multiline", 28 | "exports": "always-multiline", 29 | "functions": "always-multiline" 30 | } 31 | ], 32 | "comma-spacing": "error", 33 | "object-curly-spacing": [ 34 | "error", 35 | "always", 36 | { 37 | "objectsInObjects": true, 38 | "arraysInObjects": true 39 | } 40 | ], 41 | "array-bracket-spacing": ["error", "never"], 42 | "curly": ["error", "all"], 43 | "func-call-spacing": ["error", "never"], 44 | "no-lonely-if": "error", 45 | "prefer-const": "error", 46 | "prefer-arrow-callback": "error", 47 | "no-shadow": "error", 48 | "indent": ["error", 2], 49 | "no-console": "warn" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | .vscode 3 | .history 4 | .DS_Store 5 | /samples/ 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eslint-jest-testing-library-codemod 2 | 3 | **eslint-jest-testing-library-codemod** provides a set of autofixes to make migration to [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library) ruleset less painful. Codemod is based on [jscodeshift](https://github.com/facebook/jscodeshift). 4 | 5 | ## Usage 6 | ``` 7 | yarn transform --fix= --