From f0ec63d97524d84f5dac4589746dbe79e9803487 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 9 Aug 2019 13:40:29 +1200 Subject: [PATCH 1/4] chore(packages): install `babel-plugin-replace-ts-export-assignment` --- package.json | 1 + yarn.lock | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a623ee36..94f393edc 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "@typescript-eslint/eslint-plugin": "^1.13.0", "@typescript-eslint/parser": "^1.13.0", "babel-jest": "^24.8.0", + "babel-plugin-replace-ts-export-assignment": "^0.0.1", "eslint": "^5.1.0", "eslint-config-prettier": "^5.1.0", "eslint-plugin-eslint-plugin": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 01d2586eb..afc3754fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26,7 +26,7 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0", "@babel/core@^7.4.4": +"@babel/core@^7.1.0", "@babel/core@^7.4.4", "@babel/core@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.5.tgz#17b2686ef0d6bc58f963dddd68ab669755582c30" integrity sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg== @@ -1421,6 +1421,15 @@ babel-plugin-jest-hoist@^24.6.0: dependencies: "@types/babel__traverse" "^7.0.6" +babel-plugin-replace-ts-export-assignment@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-replace-ts-export-assignment/-/babel-plugin-replace-ts-export-assignment-0.0.1.tgz#78305d7e15fe1cbfff7bbbfdf7f0cf92f21a15d6" + integrity sha512-YBhWpHLAveoXQSDiiU0lk1pPDHKeBpDTcwjUTdzFOTe40kAGxcSM+XvD7Vp6SP9D79eBKNHgG5Ji3cigPjAcfw== + dependencies: + "@babel/core" "^7.5.5" + "@babel/template" "^7.4.4" + "@babel/types" "^7.5.5" + babel-polyfill@6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" From cde5181d7cfa3dcf737ca342b23a5a15f35ba750 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 9 Aug 2019 13:40:58 +1200 Subject: [PATCH 2/4] chore(index): use export assignment for export --- babel.config.js | 1 + src/index.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/babel.config.js b/babel.config.js index ba2c691af..65965928f 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,6 +1,7 @@ 'use strict'; module.exports = { + plugins: ['replace-ts-export-assignment'], presets: [ '@babel/preset-typescript', ['@babel/preset-env', { targets: { node: 6 } }], diff --git a/src/index.ts b/src/index.ts index 984b0c702..6965c42e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,8 +29,7 @@ const allRules = Object.keys(rules).reduce>( {}, ); -// eslint-disable-next-line import/no-commonjs -module.exports = { +export = { configs: { all: { plugins: ['jest'], From 6c25d03bdfee09d86501a6d4d878612c5001f325 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 9 Aug 2019 13:41:34 +1200 Subject: [PATCH 3/4] chore(rules): eliminate `@ts-ignore` by fixing import --- src/__tests__/rules.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/__tests__/rules.test.ts b/src/__tests__/rules.test.ts index 7b4021486..b7659cc24 100644 --- a/src/__tests__/rules.test.ts +++ b/src/__tests__/rules.test.ts @@ -1,9 +1,8 @@ import { existsSync } from 'fs'; import { resolve } from 'path'; -// @ts-ignore -import { rules } from '../'; +import plugin from '../'; -const ruleNames = Object.keys(rules); +const ruleNames = Object.keys(plugin.rules); const numberOfRules = 38; describe('rules', () => { From 4e4811e8f48151d6c947c2f74993f2ef498cfc31 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sat, 10 Aug 2019 00:03:30 +1200 Subject: [PATCH 4/4] chore(packages): update `babel-plugin-replace-ts-export-assignment` --- package.json | 2 +- yarn.lock | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 94f393edc..db9238c34 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@typescript-eslint/eslint-plugin": "^1.13.0", "@typescript-eslint/parser": "^1.13.0", "babel-jest": "^24.8.0", - "babel-plugin-replace-ts-export-assignment": "^0.0.1", + "babel-plugin-replace-ts-export-assignment": "^0.0.2", "eslint": "^5.1.0", "eslint-config-prettier": "^5.1.0", "eslint-plugin-eslint-plugin": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index afc3754fb..994e40ecb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26,7 +26,7 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0", "@babel/core@^7.4.4", "@babel/core@^7.5.5": +"@babel/core@^7.1.0", "@babel/core@^7.4.4": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.5.tgz#17b2686ef0d6bc58f963dddd68ab669755582c30" integrity sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg== @@ -1421,14 +1421,10 @@ babel-plugin-jest-hoist@^24.6.0: dependencies: "@types/babel__traverse" "^7.0.6" -babel-plugin-replace-ts-export-assignment@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/babel-plugin-replace-ts-export-assignment/-/babel-plugin-replace-ts-export-assignment-0.0.1.tgz#78305d7e15fe1cbfff7bbbfdf7f0cf92f21a15d6" - integrity sha512-YBhWpHLAveoXQSDiiU0lk1pPDHKeBpDTcwjUTdzFOTe40kAGxcSM+XvD7Vp6SP9D79eBKNHgG5Ji3cigPjAcfw== - dependencies: - "@babel/core" "^7.5.5" - "@babel/template" "^7.4.4" - "@babel/types" "^7.5.5" +babel-plugin-replace-ts-export-assignment@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-replace-ts-export-assignment/-/babel-plugin-replace-ts-export-assignment-0.0.2.tgz#927a30ba303fcf271108980a8d4f80a693e1d53f" + integrity sha512-BiTEG2Ro+O1spuheL5nB289y37FFmz0ISE6GjpNCG2JuA/WNcuEHSYw01+vN8quGf208sID3FnZFDwVyqX18YQ== babel-polyfill@6.26.0: version "6.26.0"