diff --git a/package.json b/package.json index e84440995..1d49ecbba 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,10 @@ "ci:coverage:submit": "node scripts/codecov", "ci:lint": "node scripts/run-changed.js ci:lint", "ci:test": "node scripts/run-changed.js ci:test", - "lint": "pnpm run lint:docs && pnpm run lint:package && node scripts/run-changed.js lint", - "lint:docs": "prettier --write README.md", + "lint": "pnpm run lint:docs && npm run lint:json && pnpm run lint:package && node scripts/run-changed.js lint", + "lint:docs": "prettier --single-quote --write README.md", "lint:js": "eslint scripts util", + "lint:json": "prettier --single-quote --write tsconfig.*.json codecov.yml pnpm-workspace.yaml", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "preinstall": "node scripts/disallow-npm.js", "pub": "node scripts/pub.js", diff --git a/packages/alias/package.json b/packages/alias/package.json index c78496ed9..37d0d4e37 100755 --- a/packages/alias/package.json +++ b/packages/alias/package.json @@ -22,7 +22,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test --ext .js,.ts", + "lint:js": "eslint --fix --cache src test types --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/alias/tsconfig.json b/packages/alias/tsconfig.json index 11a2c4d75..eb2531749 100644 --- a/packages/alias/tsconfig.json +++ b/packages/alias/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "lib": ["es6"], - "module": "esnext" - }, "include": [ "src/**/*", "types/**/*" diff --git a/packages/alias/types/index.d.ts b/packages/alias/types/index.d.ts index 701286855..d826f8f35 100644 --- a/packages/alias/types/index.d.ts +++ b/packages/alias/types/index.d.ts @@ -1,35 +1,35 @@ import { Plugin, ResolveIdResult } from 'rollup'; export interface Alias { - find: string | RegExp; - replacement: string; - customResolver?: ResolverFunction | ResolverObject | null; + find: string | RegExp; + replacement: string; + customResolver?: ResolverFunction | ResolverObject | null; } export type ResolverFunction = ( - source: string, - importer: string | undefined + source: string, + importer: string | undefined ) => Promise | ResolveIdResult; export interface ResolverObject { - resolveId: ResolverFunction; + resolveId: ResolverFunction; } export interface RollupAliasOptions { - /** - * Instructs the plugin to use an alternative resolving algorithm, - * rather than the Rollup's resolver. - * @default null - */ - customResolver?: ResolverFunction | ResolverObject | null; + /** + * Instructs the plugin to use an alternative resolving algorithm, + * rather than the Rollup's resolver. + * @default null + */ + customResolver?: ResolverFunction | ResolverObject | null; - /** - * Specifies an `Object`, or an `Array` of `Object`, - * which defines aliases used to replace values in `import` or `require` statements. - * With either format, the order of the entries is important, - * in that the first defined rules are applied first. - */ - entries?: readonly Alias[] | { [find: string]: string }; + /** + * Specifies an `Object`, or an `Array` of `Object`, + * which defines aliases used to replace values in `import` or `require` statements. + * With either format, the order of the entries is important, + * in that the first defined rules are applied first. + */ + entries?: readonly Alias[] | { [find: string]: string }; } /** diff --git a/packages/auto-install/tsconfig.json b/packages/auto-install/tsconfig.json index 11a2c4d75..eb2531749 100644 --- a/packages/auto-install/tsconfig.json +++ b/packages/auto-install/tsconfig.json @@ -1,9 +1,5 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "lib": ["es6"], - "module": "esnext" - }, "include": [ "src/**/*", "types/**/*" diff --git a/packages/beep/package.json b/packages/beep/package.json index 1296f8d7a..fac5babf7 100644 --- a/packages/beep/package.json +++ b/packages/beep/package.json @@ -21,7 +21,7 @@ "ci:test": "ava --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache lib test --ext .js,.ts", + "lint:js": "eslint --fix --cache lib test types --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "test": "ava" }, diff --git a/packages/beep/types/index.d.ts b/packages/beep/types/index.d.ts index 65cbc60d8..6df01ce2f 100644 --- a/packages/beep/types/index.d.ts +++ b/packages/beep/types/index.d.ts @@ -1,6 +1,6 @@ -import { Plugin } from 'rollup'; - -/** - * 🍣 A Rollup plugin that beeps when a build ends with errors. - */ -export default function beep(): Plugin; +import { Plugin } from 'rollup'; + +/** + * 🍣 A Rollup plugin that beeps when a build ends with errors. + */ +export default function beep(): Plugin; diff --git a/packages/buble/tsconfig.json b/packages/buble/tsconfig.json index d7cd9de94..eb2531749 100644 --- a/packages/buble/tsconfig.json +++ b/packages/buble/tsconfig.json @@ -1,13 +1,7 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "lib": ["es6"], - "module": "esnext", - "allowJs": true - }, "include": [ "src/**/*", - "types/**/*", - "typings-test.js" + "types/**/*" ] } diff --git a/packages/dsv/package.json b/packages/dsv/package.json index 855bcd1b3..33849d0fb 100755 --- a/packages/dsv/package.json +++ b/packages/dsv/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/html/package.json b/packages/html/package.json index b4bb1f14c..b7a17fbfe 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -21,7 +21,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write *.md", - "lint:js": "eslint --fix --cache lib test", + "lint:js": "eslint --fix --cache lib test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prepublishOnly": "pnpm run lint", "test": "ava" diff --git a/packages/image/package.json b/packages/image/package.json index 5c373209d..c9bbdddec 100644 --- a/packages/image/package.json +++ b/packages/image/package.json @@ -22,7 +22,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write *.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/inject/package.json b/packages/inject/package.json index 5a1b0aa0e..5a7a2ce86 100644 --- a/packages/inject/package.json +++ b/packages/inject/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose && pnpm run test:ts", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/inject/test/types.ts b/packages/inject/test/types.ts index 98559de0f..00eec291f 100644 --- a/packages/inject/test/types.ts +++ b/packages/inject/test/types.ts @@ -1,24 +1,22 @@ -// @ts-check -import { dirname } from "path"; +import { RollupOptions } from 'rollup'; -import inject, { RollupInjectOptions } from ".."; +import inject from '..'; -/** @type {import("rollup").RollupOptions} */ -const config = { - input: "main.js", +const config: RollupOptions = { + input: 'main.js', output: { - file: "bundle.js", - format: "iife" + file: 'bundle.js', + format: 'iife' }, plugins: [ inject({ - include: "config.js", - exclude: "node_modules/**", - Promise: ["es6-promise", "Promise"], - $: "jquery", + include: 'config.js', + exclude: 'node_modules/**', + Promise: ['es6-promise', 'Promise'], + $: 'jquery', modules: { - Promise: ["es6-promise", "Promise"], - $: "jquery" + Promise: ['es6-promise', 'Promise'], + $: 'jquery' } }) ] diff --git a/packages/json/package.json b/packages/json/package.json index 8ee97e5e5..d6784e5c6 100755 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -17,9 +17,10 @@ "ci:lint": "pnpm run build && pnpm run lint", "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}", "ci:test": "pnpm run test -- --verbose && pnpm run test:ts", - "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", + "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:json && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", "lint:js": "eslint --fix --cache src test types --ext .js,.ts", + "lint:json": "prettier --write \"test/fixtures/!(garbage)/*.json\"", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/json/test/fixtures/array/config.json b/packages/json/test/fixtures/array/config.json index feb087e74..b5d8bb58d 100755 --- a/packages/json/test/fixtures/array/config.json +++ b/packages/json/test/fixtures/array/config.json @@ -1,3 +1 @@ -[ - 1, 2, 3 -] +[1, 2, 3] diff --git a/packages/json/test/fixtures/basic/config.json b/packages/json/test/fixtures/basic/config.json index 5d18e67d2..0a6e8769b 100755 --- a/packages/json/test/fixtures/basic/config.json +++ b/packages/json/test/fixtures/basic/config.json @@ -1,3 +1,3 @@ { - "answer": 42 + "answer": 42 } diff --git a/packages/json/test/fixtures/extensionless/config.json b/packages/json/test/fixtures/extensionless/config.json index 5d18e67d2..0a6e8769b 100755 --- a/packages/json/test/fixtures/extensionless/config.json +++ b/packages/json/test/fixtures/extensionless/config.json @@ -1,3 +1,3 @@ { - "answer": 42 + "answer": 42 } diff --git a/packages/json/test/fixtures/extensionless/dir/index.json b/packages/json/test/fixtures/extensionless/dir/index.json index aac70eac2..6092acb91 100755 --- a/packages/json/test/fixtures/extensionless/dir/index.json +++ b/packages/json/test/fixtures/extensionless/dir/index.json @@ -1,3 +1,3 @@ { - "Are extensionless imports and /index resolutions a good idea?": "No." + "Are extensionless imports and /index resolutions a good idea?": "No." } diff --git a/packages/json/test/fixtures/named/package.json b/packages/json/test/fixtures/named/package.json index 595e4d544..6a0a1011d 100755 --- a/packages/json/test/fixtures/named/package.json +++ b/packages/json/test/fixtures/named/package.json @@ -1,4 +1,4 @@ { - "name": "this-should-be-excluded", - "version": "1.33.7" + "name": "this-should-be-excluded", + "version": "1.33.7" } diff --git a/packages/legacy/package.json b/packages/legacy/package.json index 00571e3a6..36761db09 100644 --- a/packages/legacy/package.json +++ b/packages/legacy/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/multi-entry/package.json b/packages/multi-entry/package.json index e925791ee..e02ce3939 100755 --- a/packages/multi-entry/package.json +++ b/packages/multi-entry/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/pluginutils/package.json b/packages/pluginutils/package.json index fcac22dd2..571137946 100644 --- a/packages/pluginutils/package.json +++ b/packages/pluginutils/package.json @@ -24,7 +24,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src --ext .js,.ts", + "lint:js": "eslint --fix --cache src test types --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", @@ -47,6 +47,7 @@ "rollup": "^1.20.0" }, "dependencies": { + "@types/estree": "0.0.39", "estree-walker": "^1.0.1", "micromatch": "^4.0.2" }, @@ -54,7 +55,6 @@ "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-node-resolve": "^7.1.1", "@rollup/plugin-typescript": "^3.0.0", - "@types/estree": "0.0.39", "@types/jest": "^24.9.0", "@types/micromatch": "^3.1.1", "@types/node": "^12.12.25", diff --git a/packages/pluginutils/rollup.config.js b/packages/pluginutils/rollup.config.js index 8b69e3db0..a2ddd2e94 100755 --- a/packages/pluginutils/rollup.config.js +++ b/packages/pluginutils/rollup.config.js @@ -9,7 +9,7 @@ export default { plugins: [ resolve(), commonjs({ include: '../../node_modules/.pnpm/registry.npmjs.org/**' }), - typescript({ include: '**/*.{ts,js}' }) + typescript({ include: '**/*.{ts,js}', module: 'esnext' }) ], external: Object.keys(pkg.dependencies).concat('path', 'util'), output: [ diff --git a/packages/pluginutils/src/attachScopes.ts b/packages/pluginutils/src/attachScopes.ts index 83856ca23..d48b90a39 100755 --- a/packages/pluginutils/src/attachScopes.ts +++ b/packages/pluginutils/src/attachScopes.ts @@ -100,7 +100,7 @@ const attachScopes: AttachScopes = function attachScopes(ast, propertyName = 'sc } // create new block scope - if (node.type === 'BlockStatement' && !/Function/.test(parent!.type)) { + if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) { newScope = new Scope({ parent: scope, block: true diff --git a/packages/pluginutils/tsconfig.json b/packages/pluginutils/tsconfig.json index dc3cca649..56aa7e6a4 100644 --- a/packages/pluginutils/tsconfig.json +++ b/packages/pluginutils/tsconfig.json @@ -1,11 +1,12 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "lib": ["es6"], - "esModuleInterop": true + "esModuleInterop": true, + "module": "commonjs" }, "include": [ "src/**/*", + "test/**/*", "types/**/*" ] } diff --git a/packages/pluginutils/types/index.d.ts b/packages/pluginutils/types/index.d.ts index d03411b67..33d40e509 100755 --- a/packages/pluginutils/types/index.d.ts +++ b/packages/pluginutils/types/index.d.ts @@ -1,14 +1,11 @@ +// eslint-disable-next-line import/no-unresolved import { BaseNode } from 'estree'; export interface AttachedScope { parent?: AttachedScope; isBlockScope: boolean; declarations: { [key: string]: boolean }; - addDeclaration( - node: BaseNode, - isBlockDeclaration: boolean, - isVar: boolean - ): void; + addDeclaration(node: BaseNode, isBlockDeclaration: boolean, isVar: boolean): void; contains(name: string): boolean; } @@ -35,10 +32,7 @@ export function addExtension(filename: string, ext?: string): string; * Each `Scope` object has a `scope.contains(name)` method that returns `true` * if a given name is defined in the current scope or a parent scope. */ -export function attachScopes( - ast: BaseNode, - propertyName?: string -): AttachedScope; +export function attachScopes(ast: BaseNode, propertyName?: string): AttachedScope; /** * Constructs a filter function which can be used to determine whether or not diff --git a/packages/strip/package.json b/packages/strip/package.json index b1e753fa0..afcef3ddd 100644 --- a/packages/strip/package.json +++ b/packages/strip/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test/test.js", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "pretest": "pnpm run build", "test": "ava" diff --git a/packages/strip/test/fixtures/assert/input.js b/packages/strip/test/fixtures/assert/input.js index f3a59aa33..fddefeed9 100755 --- a/packages/strip/test/fixtures/assert/input.js +++ b/packages/strip/test/fixtures/assert/input.js @@ -1,3 +1,4 @@ +/* eslint-disable */ function foo(message) { assert.equal(arguments.length, 1); assert.equal(typeof arguments[0], 'string'); diff --git a/packages/strip/test/fixtures/super-method/input.js b/packages/strip/test/fixtures/super-method/input.js index 254c6f39b..2e4b21172 100755 --- a/packages/strip/test/fixtures/super-method/input.js +++ b/packages/strip/test/fixtures/super-method/input.js @@ -1,3 +1,4 @@ +/* eslint-disable */ class Foo { bar() { a(); diff --git a/packages/strip/test/snapshots/test.js.md b/packages/strip/test/snapshots/test.js.md index cc530b8c0..76bed0fd5 100644 --- a/packages/strip/test/snapshots/test.js.md +++ b/packages/strip/test/snapshots/test.js.md @@ -40,7 +40,8 @@ Generated by [AVA](https://ava.li). > Snapshot 1 - `function foo(message) {␊ + `/* eslint-disable */␊ + function foo(message) {␊ bar(message);␊ }␊ ` @@ -113,7 +114,8 @@ Generated by [AVA](https://ava.li). > Snapshot 1 - `class Foo {␊ + `/* eslint-disable */␊ + class Foo {␊ bar() {␊ a();␊ b();␊ diff --git a/packages/strip/test/snapshots/test.js.snap b/packages/strip/test/snapshots/test.js.snap index a6c7c5620..5c1e641a4 100644 Binary files a/packages/strip/test/snapshots/test.js.snap and b/packages/strip/test/snapshots/test.js.snap differ diff --git a/packages/sucrase/package.json b/packages/sucrase/package.json index 6c88183d2..5e6198f34 100644 --- a/packages/sucrase/package.json +++ b/packages/sucrase/package.json @@ -22,7 +22,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 153184679..a96523e91 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -20,9 +20,10 @@ "ci:lint": "pnpm run build && pnpm run lint", "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}", "ci:test": "pnpm run test -- --verbose --serial", - "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", + "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:json && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test --ext .js,.ts", + "lint:js": "eslint --fix --cache src test types --ext .js,.ts", + "lint:json": "prettier --write **/tsconfig.json", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/typescript/test/fixtures/project-references/animals/tsconfig.json b/packages/typescript/test/fixtures/project-references/animals/tsconfig.json index f6b2cc49e..2642d5c3d 100644 --- a/packages/typescript/test/fixtures/project-references/animals/tsconfig.json +++ b/packages/typescript/test/fixtures/project-references/animals/tsconfig.json @@ -1,10 +1,8 @@ -{ - "extends": "../tsconfig-base.json", - "compilerOptions": { - "outDir": "../lib/animals", - "rootDir": ".", - }, - "references": [ - { "path": "../core" } - ] -} +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": "." + }, + "references": [{ "path": "../core" }] +} diff --git a/packages/typescript/test/fixtures/project-references/core/tsconfig.json b/packages/typescript/test/fixtures/project-references/core/tsconfig.json index 9b381b9a5..27a28497e 100644 --- a/packages/typescript/test/fixtures/project-references/core/tsconfig.json +++ b/packages/typescript/test/fixtures/project-references/core/tsconfig.json @@ -1,7 +1,7 @@ -{ - "extends": "../tsconfig-base.json", - "compilerOptions": { - "outDir": "../lib/core", - "rootDir": "." - } -} \ No newline at end of file +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + } +} diff --git a/packages/typescript/test/fixtures/project-references/tsconfig.json b/packages/typescript/test/fixtures/project-references/tsconfig.json index a140d4ef8..40992837c 100644 --- a/packages/typescript/test/fixtures/project-references/tsconfig.json +++ b/packages/typescript/test/fixtures/project-references/tsconfig.json @@ -1,14 +1,14 @@ -{ - "files": [], - "references": [ - { - "path": "./core" - }, - { - "path": "./animals" - }, - { - "path": "./zoo" - } - ] -} \ No newline at end of file +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals" + }, + { + "path": "./zoo" + } + ] +} diff --git a/packages/typescript/test/fixtures/project-references/zoo/tsconfig.json b/packages/typescript/test/fixtures/project-references/zoo/tsconfig.json index 318c0dc06..854eea033 100644 --- a/packages/typescript/test/fixtures/project-references/zoo/tsconfig.json +++ b/packages/typescript/test/fixtures/project-references/zoo/tsconfig.json @@ -1,12 +1,12 @@ -{ - "extends": "../tsconfig-base.json", - "compilerOptions": { - "outDir": "../lib/zoo", - "rootDir": "." - }, - "references": [ - { - "path": "../animals" - } - ] -} \ No newline at end of file +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} diff --git a/packages/typescript/test/fixtures/tsconfig-extends-module/tsconfig.json b/packages/typescript/test/fixtures/tsconfig-extends-module/tsconfig.json index 5222ba6cb..60ecd8aae 100644 --- a/packages/typescript/test/fixtures/tsconfig-extends-module/tsconfig.json +++ b/packages/typescript/test/fixtures/tsconfig-extends-module/tsconfig.json @@ -1,6 +1,6 @@ -{ - "extends": "shared-config", - "compilerOptions": { - "allowJs": true - } -} +{ + "extends": "shared-config", + "compilerOptions": { + "allowJs": true + } +} diff --git a/packages/typescript/tsconfig.json b/packages/typescript/tsconfig.json index d7cd9de94..0e6f93f42 100644 --- a/packages/typescript/tsconfig.json +++ b/packages/typescript/tsconfig.json @@ -1,13 +1,4 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "lib": ["es6"], - "module": "esnext", - "allowJs": true - }, - "include": [ - "src/**/*", - "types/**/*", - "typings-test.js" - ] + "include": ["src/**/*", "types/**/*"] } diff --git a/packages/url/package.json b/packages/url/package.json index f3e0b2636..c7e8f93bb 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -22,7 +22,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/virtual/package.json b/packages/virtual/package.json index 90938dce5..a1f844a8d 100755 --- a/packages/virtual/package.json +++ b/packages/virtual/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 57d684da9..266668e48 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/packages/yaml/package.json b/packages/yaml/package.json index 88965698e..58d0724cf 100755 --- a/packages/yaml/package.json +++ b/packages/yaml/package.json @@ -19,7 +19,7 @@ "ci:test": "pnpm run test -- --verbose", "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", "lint:docs": "prettier --single-quote --write README.md", - "lint:js": "eslint --fix --cache src test", + "lint:js": "eslint --fix --cache src test --ext .js,.ts", "lint:package": "prettier --write package.json --plugin=prettier-plugin-package", "prebuild": "del-cli dist", "prepare": "pnpm run build", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5b1e33737..94351a7da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -284,13 +284,13 @@ importers: string-capitalize: ^1.0.1 packages/pluginutils: dependencies: + '@types/estree': 0.0.39 estree-walker: 1.0.1 micromatch: 4.0.2 devDependencies: '@rollup/plugin-commonjs': 11.0.2 '@rollup/plugin-node-resolve': 7.1.1 '@rollup/plugin-typescript': 3.0.0_typescript@3.7.5 - '@types/estree': 0.0.39 '@types/jest': 24.9.0 '@types/micromatch': 3.1.1 '@types/node': 12.12.25 diff --git a/tsconfig.base.json b/tsconfig.base.json index 90a2ea4f9..1107da3b1 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -2,7 +2,7 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "lib": ["es6"], - "module": "commonjs", + "module": "esnext", "moduleResolution": "node", "noEmit": true, "noEmitOnError": false, diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index ed0d4251a..74b673d48 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,8 +1,4 @@ { "extends": "./tsconfig.base.json", - "include": [ - "packages", - "scripts", - "util" - ] + "include": ["packages", "scripts", "util"] }