Unify build step for ESLint packages (#10723)

This commit is contained in:
Kai Cataldo 2019-11-16 04:15:15 -05:00 committed by Nicolò Ribaudo
parent 1b75fe3cba
commit a6d134804a
250 changed files with 1174 additions and 1087 deletions

1
.gitignore vendored
View File

@ -61,6 +61,7 @@ packages/babel-preset-env-standalone/babel-preset-env.min.js
.idea/
/.changelog
/eslint/*/lib
/eslint/*/node_modules
/eslint/*/LICENSE
!/packages/babel-eslint-plugin/LICENSE

View File

@ -17,7 +17,7 @@ const rollupNodeResolve = require("rollup-plugin-node-resolve");
const rollupReplace = require("rollup-plugin-replace");
const { registerStandalonePackageTask } = require("./scripts/gulp-tasks");
const defaultSourcesGlob = "./@(codemods|packages)/*/src/**/*.js";
const defaultSourcesGlob = "./@(codemods|packages|eslint)/*/src/**/*.js";
function swapSrcWithLib(srcPath) {
const parts = srcPath.split(path.sep);

View File

@ -8,6 +8,12 @@ export FORCE_COLOR = true
SOURCES = packages codemods eslint
COMMA := ,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
COMMA_SEPARATED_SOURCES = $(subst $(SPACE),$(COMMA),$(SOURCES))
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap
build: build-bundle
@ -113,7 +119,7 @@ fix-js:
yarn eslint scripts $(SOURCES) '*.js' --format=codeframe --fix
fix-json:
yarn prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn
yarn prettier "{$(COMMA_SEPARATED_SOURCES)}/*/test/fixtures/**/options.json" --write --loglevel warn
clean: test-clean
rm -f .npmrc

View File

@ -112,6 +112,8 @@ module.exports = function(api) {
"packages/*/test",
"codemods/*/src",
"codemods/*/test",
"eslint/*/src",
"eslint/*/test",
],
sourceType: "unambiguous",
},

View File

@ -1,3 +1,3 @@
{
"plugins": ["../../../../lib"]
}
"plugins": ["../../../../lib"]
}

View File

@ -1,6 +1,4 @@
{
"sourceType": "module",
"plugins": [
"flow"
]
"plugins": ["flow"]
}

View File

@ -1,6 +1,4 @@
{
"sourceType": "module",
"plugins": [
"flow"
]
"plugins": ["flow"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"estree"
]
"plugins": ["estree"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"bigInt"
]
"plugins": ["bigInt"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classPrivateMethods"
]
"plugins": ["classPrivateMethods"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classPrivateProperties"
]
"plugins": ["classPrivateProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classPrivateProperties"
]
"plugins": ["classPrivateProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classPrivateProperties"
]
"plugins": ["classPrivateProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classPrivateProperties"
]
"plugins": ["classPrivateProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"classProperties"
]
"plugins": ["classProperties"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"dynamicImport"
]
"plugins": ["dynamicImport"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"dynamicImport"
]
"plugins": ["dynamicImport"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"dynamicImport"
]
"plugins": ["dynamicImport"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"dynamicImport"
]
"plugins": ["dynamicImport"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"dynamicImport"
]
"plugins": ["dynamicImport"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"dynamicImport"
]
"plugins": ["dynamicImport"]
}

View File

@ -1,7 +1,4 @@
{
"plugins": [
"dynamicImport",
"importMeta"
],
"plugins": ["dynamicImport", "importMeta"],
"sourceType": "script"
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"dynamicImport",
"importMeta"
]
"plugins": ["dynamicImport", "importMeta"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"dynamicImport",
"importMeta"
]
"plugins": ["dynamicImport", "importMeta"]
}

View File

@ -1,7 +1,4 @@
{
"plugins": [
"nullishCoalescingOperator",
"estree"
],
"plugins": ["nullishCoalescingOperator", "estree"],
"throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)"
}

View File

@ -1,6 +1,4 @@
{
"plugins": [
"nullishCoalescingOperator"
],
"plugins": ["nullishCoalescingOperator"],
"throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:5)"
}

View File

@ -1,6 +1,4 @@
{
"plugins": [
"nullishCoalescingOperator"
],
"plugins": ["nullishCoalescingOperator"],
"throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:10)"
}

View File

@ -1,7 +1,4 @@
{
"plugins": [
"nullishCoalescingOperator",
"estree"
],
"plugins": ["nullishCoalescingOperator", "estree"],
"throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)"
}

View File

@ -1,6 +1,3 @@
{
"plugins": [
"bigInt",
"numericSeparator"
]
"plugins": ["bigInt", "numericSeparator"]
}

View File

@ -1,6 +1,3 @@
{
"plugins": [
"bigInt",
"numericSeparator"
]
"plugins": ["bigInt", "numericSeparator"]
}

View File

@ -1,6 +1,3 @@
{
"plugins": [
"bigInt",
"numericSeparator"
]
"plugins": ["bigInt", "numericSeparator"]
}

View File

@ -1,6 +1,3 @@
{
"plugins": [
"bigInt",
"numericSeparator"
]
"plugins": ["bigInt", "numericSeparator"]
}

View File

@ -1,6 +1,3 @@
{
"plugins": [
"bigInt",
"numericSeparator"
]
"plugins": ["bigInt", "numericSeparator"]
}

View File

@ -1,6 +1,3 @@
{
"plugins": [
"bigInt",
"numericSeparator"
]
"plugins": ["bigInt", "numericSeparator"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"optionalChaining"
]
"plugins": ["optionalChaining"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"optionalChaining"
]
"plugins": ["optionalChaining"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"optionalChaining"
]
"plugins": ["optionalChaining"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"partialApplication"
]
"plugins": ["partialApplication"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"partialApplication"
]
"plugins": ["partialApplication"]
}

View File

@ -1,8 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow",
"classProperties"
]
"plugins": ["jsx", "flow", "classProperties"]
}

View File

@ -1,4 +1,3 @@
{
"plugins": [["flow", { "enums": true }]]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"jsx",
"flow"
]
"plugins": ["jsx", "flow"]
}

View File

@ -1,7 +1,4 @@
{
"sourceType": "module",
"plugins": [
"flow",
"jsx"
]
"plugins": ["flow", "jsx"]
}

View File

@ -1,5 +1,3 @@
{
"plugins": [
"typescript", "classProperties"
]
"plugins": ["typescript", "classProperties"]
}

View File

@ -1,6 +1,4 @@
{
"plugins": [
"v8intrinsic"
],
"plugins": ["v8intrinsic"],
"throws": "Unexpected token (1:0)"
}

View File

@ -1,6 +1,4 @@
{
"plugins": [
"v8intrinsic"
],
"plugins": ["v8intrinsic"],
"throws": "Unexpected token (1:2)"
}

View File

@ -1,7 +1,4 @@
{
"plugins": [
"optionalChaining",
"v8intrinsic"
],
"plugins": ["optionalChaining", "v8intrinsic"],
"throws": "Unexpected token (1:0)"
}

View File

@ -1,3 +1,6 @@
{
"plugins": ["transform-block-scoping", ["proposal-object-rest-spread", { "loose": true }]]
"plugins": [
"transform-block-scoping",
["proposal-object-rest-spread", { "loose": true }]
]
}

View File

@ -2,9 +2,12 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"corejs": 3
}]
[
"env",
{
"debug": true,
"corejs": 3
}
]
]
}

View File

@ -2,13 +2,16 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": [ "Android >= 4" ]
},
"useBuiltIns": "entry",
"corejs": 2
}]
[
"env",
{
"debug": true,
"targets": {
"browsers": ["Android >= 4"]
},
"useBuiltIns": "entry",
"corejs": 2
}
]
]
}

View File

@ -2,13 +2,16 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"electron": 0.36
},
"useBuiltIns": "entry",
"corejs": 2
}]
[
"env",
{
"debug": true,
"targets": {
"electron": 0.36
},
"useBuiltIns": "entry",
"corejs": 2
}
]
]
}

View File

@ -2,15 +2,18 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"modules": false,
"targets": {
"chrome": 55
},
"useBuiltIns": "entry",
"corejs": 2,
"forceAllTransforms": true
}]
[
"env",
{
"debug": true,
"modules": false,
"targets": {
"chrome": 55
},
"useBuiltIns": "entry",
"corejs": 2,
"forceAllTransforms": true
}
]
]
}

View File

@ -2,13 +2,16 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"node": 6
},
"useBuiltIns": "entry",
"corejs": 2
}]
[
"env",
{
"debug": true,
"targets": {
"node": 6
},
"useBuiltIns": "entry",
"corejs": 2
}
]
]
}

View File

@ -2,13 +2,16 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"useBuiltIns": "entry",
"corejs": { "version": 2, "proposals": true }
}]
[
"env",
{
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"useBuiltIns": "entry",
"corejs": { "version": 2, "proposals": true }
}
]
]
}

View File

@ -2,10 +2,13 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"useBuiltIns": "entry",
"corejs": { "version": 2, "proposals": true }
}]
[
"env",
{
"debug": true,
"useBuiltIns": "entry",
"corejs": { "version": 2, "proposals": true }
}
]
]
}

View File

@ -2,14 +2,17 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 2
}]
[
"env",
{
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 2
}
]
]
}

View File

@ -2,11 +2,14 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 2
}]
[
"env",
{
"debug": true,
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 2
}
]
]
}

View File

@ -2,13 +2,16 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49"
},
"useBuiltIns": "entry",
"corejs": 2
}]
[
"env",
{
"debug": true,
"targets": {
"browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49"
},
"useBuiltIns": "entry",
"corejs": 2
}
]
]
}

View File

@ -2,16 +2,19 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"useBuiltIns": "entry",
"corejs": 2,
"debug": true,
"targets": {
"chrome": 54,
"electron": 0.36,
"node": 6.10,
"ie": 10
[
"env",
{
"useBuiltIns": "entry",
"corejs": 2,
"debug": true,
"targets": {
"chrome": 54,
"electron": 0.36,
"node": 6.1,
"ie": 10
}
}
}]
]
]
}

View File

@ -2,15 +2,18 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"useBuiltIns": "entry",
"corejs": 2,
"debug": true,
"targets": {
"chrome": "54",
"node": "6.10",
"ie": "10"
[
"env",
{
"useBuiltIns": "entry",
"corejs": 2,
"debug": true,
"targets": {
"chrome": "54",
"node": "6.10",
"ie": "10"
}
}
}]
]
]
}

View File

@ -2,14 +2,17 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": "chrome >= 54, ie 10",
"node": 6
},
"useBuiltIns": "entry",
"corejs": 2
}]
[
"env",
{
"debug": true,
"targets": {
"browsers": "chrome >= 54, ie 10",
"node": 6
},
"useBuiltIns": "entry",
"corejs": 2
}
]
]
}

View File

@ -2,14 +2,17 @@
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
[
"env",
{
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}
]
]
}

Some files were not shown because too many files have changed in this diff Show More