Skip to content

Commit

Permalink
chore: Always lint types folder
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Feb 28, 2020
1 parent d8c6ebe commit 367f618
Show file tree
Hide file tree
Showing 37 changed files with 106 additions and 135 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/alias/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions packages/alias/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": ["es6"],
"module": "esnext"
},
"include": [
"src/**/*",
"types/**/*"
Expand Down
38 changes: 19 additions & 19 deletions packages/alias/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -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> | 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 };
}

/**
Expand Down
4 changes: 0 additions & 4 deletions packages/auto-install/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": ["es6"],
"module": "esnext"
},
"include": [
"src/**/*",
"types/**/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/beep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/beep/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -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;
8 changes: 1 addition & 7 deletions packages/buble/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": ["es6"],
"module": "esnext",
"allowJs": true
},
"include": [
"src/**/*",
"types/**/*",
"typings-test.js"
"types/**/*"
]
}
2 changes: 1 addition & 1 deletion packages/dsv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/inject/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion packages/json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions packages/json/test/fixtures/array/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
1, 2, 3
]
[1, 2, 3]
2 changes: 1 addition & 1 deletion packages/json/test/fixtures/basic/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"answer": 42
"answer": 42
}
2 changes: 1 addition & 1 deletion packages/json/test/fixtures/extensionless/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"answer": 42
"answer": 42
}
2 changes: 1 addition & 1 deletion packages/json/test/fixtures/extensionless/dir/index.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"Are extensionless imports and /index resolutions a good idea?": "No."
"Are extensionless imports and /index resolutions a good idea?": "No."
}
4 changes: 2 additions & 2 deletions packages/json/test/fixtures/named/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "this-should-be-excluded",
"version": "1.33.7"
"name": "this-should-be-excluded",
"version": "1.33.7"
}
2 changes: 1 addition & 1 deletion packages/legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/multi-entry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/pluginutils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -47,14 +47,14 @@
"rollup": "^1.20.0"
},
"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",
"@types/estree": "0.0.39",
"@types/jest": "^24.9.0",
"@types/micromatch": "^3.1.1",
"@types/node": "^12.12.25",
Expand Down
1 change: 0 additions & 1 deletion packages/pluginutils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": ["es6"],
"esModuleInterop": true
},
"include": [
Expand Down
2 changes: 1 addition & 1 deletion packages/strip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/sucrase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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" }]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "../lib/core",
"rootDir": "."
}
}
{
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "../lib/core",
"rootDir": "."
}
}
28 changes: 14 additions & 14 deletions packages/typescript/test/fixtures/project-references/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"files": [],
"references": [
{
"path": "./core"
},
{
"path": "./animals"
},
{
"path": "./zoo"
}
]
}
{
"files": [],
"references": [
{
"path": "./core"
},
{
"path": "./animals"
},
{
"path": "./zoo"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "../lib/zoo",
"rootDir": "."
},
"references": [
{
"path": "../animals"
}
]
}
{
"extends": "../tsconfig-base.json",
"compilerOptions": {
"outDir": "../lib/zoo",
"rootDir": "."
},
"references": [
{
"path": "../animals"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "shared-config",
"compilerOptions": {
"allowJs": true
}
}
{
"extends": "shared-config",
"compilerOptions": {
"allowJs": true
}
}
Loading

0 comments on commit 367f618

Please sign in to comment.