diff --git a/.circleci/config.yml b/.circleci/config.yml index f02a3a80f..cd83ede4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,6 +91,7 @@ jobs: - attach_workspace: at: "." + - run: npm i -g ts-node - run: npm run test:end-to-end test-unit: @@ -143,9 +144,6 @@ workflows: - prettier: requires: - build - - test-end-to-end: - requires: - - build - test-unit: requires: - build diff --git a/.gitignore b/.gitignore index 7b7044a9b..54654c847 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ node_modules/ src/**/*.js test/*.js ~test/jest.config.js -test/tests/**/.eslintrc* +!test/tests/**/.eslintrc* +!test/tests/**/*.log diff --git a/test/jest.config.js b/test/jest.config.js index 7b1c51589..76cc908f7 100644 --- a/test/jest.config.js +++ b/test/jest.config.js @@ -1,5 +1,5 @@ module.exports = { moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], - testRegex: "test(.*)\\test\\.ts$", + testRegex: "test(.*).test.ts$", testEnvironment: "node", }; diff --git a/test/tests/custom eslint path/tslint-to-eslint-config.log b/test/tests/custom eslint path/tslint-to-eslint-config.log new file mode 100644 index 000000000..f76acb2ca --- /dev/null +++ b/test/tests/custom eslint path/tslint-to-eslint-config.log @@ -0,0 +1,2 @@ +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/.eslintrc.json b/test/tests/custom package path/.eslintrc.json new file mode 100644 index 000000000..06585f8f1 --- /dev/null +++ b/test/tests/custom package path/.eslintrc.json @@ -0,0 +1,31 @@ +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/tslint-to-eslint-config.log b/test/tests/custom package path/tslint-to-eslint-config.log new file mode 100644 index 000000000..f76acb2ca --- /dev/null +++ b/test/tests/custom package path/tslint-to-eslint-config.log @@ -0,0 +1,2 @@ +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/.eslintrc.json b/test/tests/custom typescript path/.eslintrc.json new file mode 100644 index 000000000..3dc1ec1c1 --- /dev/null +++ b/test/tests/custom typescript path/.eslintrc.json @@ -0,0 +1,31 @@ +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/tslint-to-eslint-config.log b/test/tests/custom typescript path/tslint-to-eslint-config.log new file mode 100644 index 000000000..f76acb2ca --- /dev/null +++ b/test/tests/custom typescript path/tslint-to-eslint-config.log @@ -0,0 +1,2 @@ +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/missing tslint.json/.eslintrc.json b/test/tests/missing tslint.json/.eslintrc.json new file mode 100644 index 000000000..9e8bc631d --- /dev/null +++ b/test/tests/missing tslint.json/.eslintrc.json @@ -0,0 +1,50 @@ +{ + "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-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-empty-functions": "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" + ] + } + } + ] + } +} diff --git a/test/tests/missing tslint.json/tslint-to-eslint-config.log b/test/tests/missing tslint.json/tslint-to-eslint-config.log new file mode 100644 index 000000000..e69de29bb diff --git a/test/tests/standalone tslint.json/tslint-to-eslint-config.log b/test/tests/standalone tslint.json/tslint-to-eslint-config.log new file mode 100644 index 000000000..f76acb2ca --- /dev/null +++ b/test/tests/standalone tslint.json/tslint-to-eslint-config.log @@ -0,0 +1,2 @@ +no-implicit-dependencies does not yet have an ESLint equivalent. +strict-boolean-expressions does not yet have an ESLint equivalent.