diff --git a/.circleci/config.yml b/.circleci/config.yml index 7fc6f2dfe..ba440ceed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,7 +79,7 @@ jobs: - run: npm run prettier - test-end-to-end: + test: docker: - image: circleci/node:latest @@ -91,21 +91,7 @@ jobs: - attach_workspace: at: "." - - run: npm run test:end-to-end - - test-unit: - docker: - - image: circleci/node:latest - - working_directory: ~/repo - - steps: - - checkout - - - attach_workspace: - at: "." - - - run: npm run test:unit -- --coverage + - run: npm run test -- --coverage tsc: docker: @@ -143,11 +129,7 @@ workflows: - prettier: requires: - build - - test-end-to-end: - requires: - - build - - tsc - - test-unit: + - test: requires: - build - tsc: diff --git a/docs/Development.md b/docs/Development.md index be3a32de4..2209a3050 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -17,10 +17,10 @@ cd tslint-to-eslint-config npm i ``` -Compile with `npm run tsc` and run tests with `npm run test:unit`. +Compile with `npm run tsc` and run tests with `npm run test`. ## Further Reading - [Architecture](./Architecture.md): How the general app structure operates - [Dependencies](./Dependencies.md): How functions pass and receive static dependencies -- [Testing](./Testing.md): Unit and end-to-end tests +- [Testing](./Testing.md): Unit tests diff --git a/docs/Testing.md b/docs/Testing.md index b75bd5fa6..ef173b069 100644 --- a/docs/Testing.md +++ b/docs/Testing.md @@ -1,9 +1,7 @@ # Testing -## Unit Tests - ``` -npm run test:unit +npm run test ``` Each `src/**/*.ts` source file should have an equivalent `*.test.ts` next to it. @@ -21,26 +19,3 @@ Tests should include comments above each section of the "AAA" testing format: See [Dependencies](./Dependencies.md) for how static dependencies are stubbed out in functions. That system is how functions can receive stubs and spies during unit tests. - -## End-to-End Tests - -```shell -npm run test:end-to-end -``` - -End-to-end tests that execute the `bin/tslint-to-eslint` command and validate outputs are generated from the directories in `test/tests/`. -Each directory there contains: - -- `test.ts`: Test file that runs `createTests(__dirname);` to set up tests in that directory -- `.eslintrc.json`: `.gitignore`d output from the most recent test run -- `expected.json`: Expected output ESLint configuration -- `stderr.txt`: Expected output written to the process `stderr` -- `stdout.txt`: Expected output written to the process `stdout` -- `tslint.json`: Original TSLint configuration file to convert - -Within each directory, a test suite will execute `bin/tslint-to-eslint` and validate the outputs match what's on disk. - -Use `npm run test:end-to-end:accept` to overwrite the expected contents of files with what is actually written. -These behave similarly to updating snapshots in snapshot testing. - -> Note: these end-to-end tests use the compiled result of `npm run tsc`, so if you update source code, re-run `npm run tsc` before `npm run test:end-to-end`. diff --git a/package.json b/package.json index 7999fe164..3cb09ebdc 100644 --- a/package.json +++ b/package.json @@ -60,9 +60,7 @@ "eslint": "eslint \"./src/*.ts\" \"./src/**/*.ts\" --report-unused-disable-directives", "prettier": "prettier \"./src/*.{js,json,ts,xml,yaml}\" \"./src/**/*.{js,json,ts,xml,yaml}\" --ignore-path .prettierignore", "prettier:write": "npm run prettier -- --write", - "test:unit": "jest", - "test:end-to-end": "jest --config=test/jest.config.js --runInBand", - "test:end-to-end:accept": "jest --config=test/jest.config.js --globals=\"{\\\"acceptTestChanges\\\": true }\" --runInBand", + "test": "jest", "tsc": "tsc" }, "version": "0.2.7" diff --git a/test/createTestArgs.ts b/test/createTestArgs.ts deleted file mode 100644 index 84efb2306..000000000 --- a/test/createTestArgs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as fs from "fs"; -import * as path from "path"; -import { promisify } from "util"; - -const readdir = promisify(fs.readdir); - -export const createTestArgs = async (cwd: string, extraArgs: string[]) => { - const items = new Set(await readdir(cwd)); - const flags = ["--config", path.join(cwd, ".eslintrc.json")]; - - if (items.has("tslint.json")) { - flags.push("--tslint", path.join(cwd, "tslint.json")); - } - - return [...flags.map(flag => `"${flag}"`).join(" "), ...extraArgs]; -}; diff --git a/test/createTests.ts b/test/createTests.ts deleted file mode 100644 index 8fa598c31..000000000 --- a/test/createTests.ts +++ /dev/null @@ -1,78 +0,0 @@ -import * as cp from "child_process"; -import * as fs from "fs"; -import * as path from "path"; -import { promisify } from "util"; - -import { createTestArgs } from "./createTestArgs"; -import { assertFileContents } from "./expectFileContains"; - -const exec = promisify(cp.exec); -const readFile = promisify(fs.readFile); - -export type TestSettings = { - /** - * Expected location of the output ESLint configuration file. - */ - eslint?: string; - - /** - * Any extra commands to pass to the CLI. - */ - extraArgs?: string[]; -}; - -jest.setTimeout(10000); - -const binFile = path.join(__dirname, "../bin/tslint-to-eslint-config"); - -export const createTests = ( - cwd: string, - { eslint = "./.eslintrc.json", extraArgs = [] }: TestSettings = {}, -) => { - const testName = path.basename(cwd); - const accept = "acceptTestChanges" in globalThis; - const cwdPath = (fileName: string) => path.join(cwd, fileName); - const readTestFile = async (fileName: string) => (await readFile(cwdPath(fileName))).toString(); - - const act = async (testArgs: string[]) => { - try { - return await exec(`node ${binFile} ${testArgs.join(" ")}`, { - cwd, - }); - } catch (error) { - return error; - } - }; - - describe(testName, () => { - test("configuration output", async () => { - // Arrange - const testArgs = await createTestArgs(cwd, extraArgs); - - // Act - await act(testArgs); - - await assertFileContents(cwdPath("expected.json"), await readTestFile(eslint), accept); - }); - - test("stderr", async () => { - // Arrange - const testArgs = await createTestArgs(cwd, extraArgs); - - // Act - const result = await act(testArgs); - - await assertFileContents(cwdPath("stderr.txt"), result.stderr, accept); - }); - - test("stdout", async () => { - // Arrange - const testArgs = await createTestArgs(cwd, extraArgs); - - // Act - const result = await act(testArgs); - - await assertFileContents(cwdPath("stdout.txt"), result.stdout, accept); - }); - }); -}; diff --git a/test/expectFileContains.ts b/test/expectFileContains.ts deleted file mode 100644 index 1add7066d..000000000 --- a/test/expectFileContains.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as fs from "fs"; -import { promisify } from "util"; - -const readFile = promisify(fs.readFile); -const writeFile = promisify(fs.writeFile); - -const standardizeEndlines = (text: string) => text.replace(/\r/g, ""); - -export const assertFileContents = async ( - filePath: string, - actual: string | Buffer, - accept: boolean, -) => { - await (accept ? acceptFileContents : expectFileContents)(filePath, actual.toString()); -}; - -const acceptFileContents = async (filePath: string, actual: string) => { - await writeFile(filePath, actual); -}; - -const expectFileContents = async (filePath: string, actual: string) => { - const expected = (await readFile(filePath)).toString(); - - expect(standardizeEndlines(actual)).toEqual(standardizeEndlines(expected)); -}; diff --git a/test/jest.config.js b/test/jest.config.js deleted file mode 100644 index 76cc908f7..000000000 --- a/test/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], - testRegex: "test(.*).test.ts$", - testEnvironment: "node", -}; diff --git a/test/tests/custom eslint path/eslintrc.js b/test/tests/custom eslint path/eslintrc.js deleted file mode 100644 index 67cd63656..000000000 --- a/test/tests/custom eslint path/eslintrc.js +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/custom eslint path/expected.json b/test/tests/custom eslint path/expected.json deleted file mode 100644 index 67cd63656..000000000 --- a/test/tests/custom eslint path/expected.json +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - }, - "globals": {}, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "settings": { - "import/resolver": { - "node": { - "extensions": [ - ".mjs", - ".js", - ".json" - ] - } - }, - "import/extensions": [ - ".js", - ".mjs", - ".jsx" - ], - "import/core-modules": [], - "import/ignore": [ - "node_modules", - "\\.(coffee|scss|css|less|hbs|svg|json)$" - ] - } -}; diff --git a/test/tests/custom eslint path/stderr.txt b/test/tests/custom eslint path/stderr.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/tests/custom eslint path/stdout.txt b/test/tests/custom eslint path/stdout.txt deleted file mode 100644 index 5b5f91fc5..000000000 --- a/test/tests/custom eslint path/stdout.txt +++ /dev/null @@ -1,5 +0,0 @@ -✨ 19 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 1 package is required for new ESLint rules. ⚡ - unicorn -✅ All is well! ✅ diff --git a/test/tests/custom eslint path/test.ts b/test/tests/custom eslint path/test.ts deleted file mode 100644 index 31c11e9b1..000000000 --- a/test/tests/custom eslint path/test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createTests } from "../../createTests"; - -const eslint = "./eslintrc.js"; - -createTests(__dirname, { - eslint, - extraArgs: ["--eslint", eslint], -}); \ No newline at end of file diff --git a/test/tests/custom eslint path/tslint-to-eslint-config.log b/test/tests/custom eslint path/tslint-to-eslint-config.log deleted file mode 100644 index f76acb2ca..000000000 --- a/test/tests/custom eslint path/tslint-to-eslint-config.log +++ /dev/null @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/custom eslint path/tslint.json b/test/tests/custom eslint path/tslint.json deleted file mode 100644 index 4a2aa47f4..000000000 --- a/test/tests/custom eslint path/tslint.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "rules": { - "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, - "typedef": false - } -} diff --git a/test/tests/custom package path/.eslintrc.json b/test/tests/custom package path/.eslintrc.json deleted file mode 100644 index 06585f8f1..000000000 --- a/test/tests/custom package path/.eslintrc.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - es6: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom package path/eslintrc.js b/test/tests/custom package path/eslintrc.js deleted file mode 100644 index 04c4b5f7e..000000000 --- a/test/tests/custom package path/eslintrc.js +++ /dev/null @@ -1,61 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -}; diff --git a/test/tests/custom package path/expected.json b/test/tests/custom package path/expected.json deleted file mode 100644 index 06585f8f1..000000000 --- a/test/tests/custom package path/expected.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - es6: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom package path/my-package.json b/test/tests/custom package path/my-package.json deleted file mode 100644 index 22a1726cf..000000000 --- a/test/tests/custom package path/my-package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "dependencies": { - "chalk": "2.4.2", - "commander": "2.20.0", - "tslint": "5.18.0", - "typescript": "3.5.3" - }, - "devDependencies": { - "@babel/core": "7.5.5", - "@babel/preset-env": "7.5.5", - "@babel/preset-typescript": "7.3.3", - "@types/jest": "24.0.15", - "@types/node": "12.6.8", - "@typescript-eslint/eslint-plugin": "1.12.0", - "@typescript-eslint/parser": "1.12.0", - "babel-jest": "24.8.0", - "eslint": "6.0.1", - "eslint-config-airbnb": "17.1.1", - "eslint-config-airbnb-base": "13.2.0", - "eslint-config-prettier": "6.0.0", - "eslint-plugin-import": "2.18.2" - }, - "version": "1.2.3" -} diff --git a/test/tests/custom package path/stderr.txt b/test/tests/custom package path/stderr.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/tests/custom package path/stdout.txt b/test/tests/custom package path/stdout.txt deleted file mode 100644 index 5b5f91fc5..000000000 --- a/test/tests/custom package path/stdout.txt +++ /dev/null @@ -1,5 +0,0 @@ -✨ 19 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 1 package is required for new ESLint rules. ⚡ - unicorn -✅ All is well! ✅ diff --git a/test/tests/custom package path/test.ts b/test/tests/custom package path/test.ts deleted file mode 100644 index f6cb1d22a..000000000 --- a/test/tests/custom package path/test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { createTests } from "../../createTests"; - -createTests(__dirname, { - extraArgs: ["--package", "my-package.json"], -}); \ No newline at end of file diff --git a/test/tests/custom package path/tslint-to-eslint-config.log b/test/tests/custom package path/tslint-to-eslint-config.log deleted file mode 100644 index f76acb2ca..000000000 --- a/test/tests/custom package path/tslint-to-eslint-config.log +++ /dev/null @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/custom package path/tslint.json b/test/tests/custom package path/tslint.json deleted file mode 100644 index 4a2aa47f4..000000000 --- a/test/tests/custom package path/tslint.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "rules": { - "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, - "typedef": false - } -} diff --git a/test/tests/custom typescript path/.eslintrc.json b/test/tests/custom typescript path/.eslintrc.json deleted file mode 100644 index 3dc1ec1c1..000000000 --- a/test/tests/custom typescript path/.eslintrc.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - browser: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom typescript path/eslintrc.js b/test/tests/custom typescript path/eslintrc.js deleted file mode 100644 index 1727af53d..000000000 --- a/test/tests/custom typescript path/eslintrc.js +++ /dev/null @@ -1,60 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -}; diff --git a/test/tests/custom typescript path/expected.json b/test/tests/custom typescript path/expected.json deleted file mode 100644 index 3dc1ec1c1..000000000 --- a/test/tests/custom typescript path/expected.json +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - env: { - browser: true, - node: true, - }, - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - sourceType: "module", - }, - plugins: ["@typescript-eslint", "@typescript-eslint/tslint"], - rules: { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "no-implicit-dependencies": [true, "dev"], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number", - ], - }, - }, - ], - }, -}; diff --git a/test/tests/custom typescript path/stderr.txt b/test/tests/custom typescript path/stderr.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/tests/custom typescript path/stdout.txt b/test/tests/custom typescript path/stdout.txt deleted file mode 100644 index 5b5f91fc5..000000000 --- a/test/tests/custom typescript path/stdout.txt +++ /dev/null @@ -1,5 +0,0 @@ -✨ 19 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 1 package is required for new ESLint rules. ⚡ - unicorn -✅ All is well! ✅ diff --git a/test/tests/custom typescript path/test.ts b/test/tests/custom typescript path/test.ts deleted file mode 100644 index 1420bc31b..000000000 --- a/test/tests/custom typescript path/test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { createTests } from "../../createTests"; - -createTests(__dirname, { - extraArgs: ["--typescript", "./tsconfig.custom.json"], -}); \ No newline at end of file diff --git a/test/tests/custom typescript path/tsconfig.custom.json b/test/tests/custom typescript path/tsconfig.custom.json deleted file mode 100644 index 10830e07b..000000000 --- a/test/tests/custom typescript path/tsconfig.custom.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "lib": ["dom"] - } -} diff --git a/test/tests/custom typescript path/tslint-to-eslint-config.log b/test/tests/custom typescript path/tslint-to-eslint-config.log deleted file mode 100644 index f76acb2ca..000000000 --- a/test/tests/custom typescript path/tslint-to-eslint-config.log +++ /dev/null @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/custom typescript path/tslint.json b/test/tests/custom typescript path/tslint.json deleted file mode 100644 index 4a2aa47f4..000000000 --- a/test/tests/custom typescript path/tslint.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "rules": { - "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, - "typedef": false - } -} diff --git a/test/tests/missing tslint.json/.eslintrc.json b/test/tests/missing tslint.json/.eslintrc.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/missing tslint.json/.eslintrc.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/missing tslint.json/expected.json b/test/tests/missing tslint.json/expected.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/missing tslint.json/expected.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/missing tslint.json/stderr.txt b/test/tests/missing tslint.json/stderr.txt deleted file mode 100644 index a1d984416..000000000 --- a/test/tests/missing tslint.json/stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -❌ Could not start tslint-to-eslint: ❌ -Command failed: tslint --print-config "./tslint.json" -Could not find configuration path. Try passing a --config to your tslint.json. - diff --git a/test/tests/missing tslint.json/stdout.txt b/test/tests/missing tslint.json/stdout.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/tests/missing tslint.json/test.ts b/test/tests/missing tslint.json/test.ts deleted file mode 100644 index ba6db888f..000000000 --- a/test/tests/missing tslint.json/test.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { createTests } from "../../createTests"; - -createTests(__dirname); diff --git a/test/tests/missing tslint.json/tslint-to-eslint-config.log b/test/tests/missing tslint.json/tslint-to-eslint-config.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/tests/standalone tslint.json/.eslintrc.json b/test/tests/standalone tslint.json/.eslintrc.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/standalone tslint.json/.eslintrc.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/standalone tslint.json/eslintrc.js b/test/tests/standalone tslint.json/eslintrc.js deleted file mode 100644 index d0a220fc6..000000000 --- a/test/tests/standalone tslint.json/eslintrc.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "import/no-default-export": "error", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "padding-line-between-statements": [ - "off", - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-template": "off", - "unicorn/filename-case": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -}; diff --git a/test/tests/standalone tslint.json/expected.json b/test/tests/standalone tslint.json/expected.json deleted file mode 100644 index 79186a52c..000000000 --- a/test/tests/standalone tslint.json/expected.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "env": { - "es6": true, - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-param-reassign": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-use-before-declare": "off", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/unbound-method": "off", - "arrow-body-style": "off", - "default-case": "off", - "linebreak-style": "off", - "no-bitwise": "off", - "no-empty": "off", - "no-magic-numbers": "off", - "prefer-template": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [ - true, - "dev" - ], - "strict-boolean-expressions": [ - true, - "allow-boolean-or-undefined", - "allow-number" - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/tests/standalone tslint.json/stderr.txt b/test/tests/standalone tslint.json/stderr.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/tests/standalone tslint.json/stdout.txt b/test/tests/standalone tslint.json/stdout.txt deleted file mode 100644 index 8e8acdb02..000000000 --- a/test/tests/standalone tslint.json/stdout.txt +++ /dev/null @@ -1,6 +0,0 @@ -✨ 20 rules replaced with their ESLint equivalents. ✨ -️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀 -⚡ 2 packages are required for new ESLint rules. ⚡ - unicorn - import -✅ All is well! ✅ diff --git a/test/tests/standalone tslint.json/test.ts b/test/tests/standalone tslint.json/test.ts deleted file mode 100644 index ba6db888f..000000000 --- a/test/tests/standalone tslint.json/test.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { createTests } from "../../createTests"; - -createTests(__dirname); diff --git a/test/tests/standalone tslint.json/tslint-to-eslint-config.log b/test/tests/standalone tslint.json/tslint-to-eslint-config.log deleted file mode 100644 index f76acb2ca..000000000 --- a/test/tests/standalone tslint.json/tslint-to-eslint-config.log +++ /dev/null @@ -1,2 +0,0 @@ -no-implicit-dependencies does not yet have an ESLint equivalent. -strict-boolean-expressions does not yet have an ESLint equivalent. diff --git a/test/tests/standalone tslint.json/tslint.json b/test/tests/standalone tslint.json/tslint.json deleted file mode 100644 index 948d7c3fa..000000000 --- a/test/tests/standalone tslint.json/tslint.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "rules": { - "array-type": [true, "array"], - "arrow-return-shorthand": false, - "completed-docs": false, - "comment-format": false, - "file-name-casing": false, - "linebreak-style": false, - "interface-name": [true, "never-prefix"], - "member-ordering": false, - "newline-before-return": false, - "no-any": false, - "no-bitwise": false, - "no-empty": false, - "no-default-export": true, - "no-magic-numbers": false, - "no-import-side-effect": false, - "no-implicit-dependencies": [true, "dev"], - "no-null-keyword": false, - "no-parameter-reassignment": false, - "no-parameter-properties": false, - "no-submodule-imports": false, - "no-unbound-method": false, - "no-unused-variable": false, - "no-use-before-declare": false, - "prefer-conditional-expression": false, - "prefer-method-signature": false, - "prefer-switch": false, - "prefer-template": false, - "promise-function-async": false, - "strict-boolean-expressions": [true, "allow-boolean-or-undefined", "allow-number"], - "switch-default": false, - "switch-final-break": false, - "typedef": false - } -}