Change trailing commas option on scripts
This commit is contained in:
parent
22dab1fa95
commit
72b1f38f91
@ -15,9 +15,9 @@
|
|||||||
"coverage-ci": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
|
"coverage-ci": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
|
||||||
"dev": "babel -w src -d lib",
|
"dev": "babel -w src -d lib",
|
||||||
"fix": "eslint . --fix",
|
"fix": "eslint . --fix",
|
||||||
|
"format": "prettier --trailing-comma all --write \"src/*.js\" \"test/*.js\" && prettier --trailing-comma es5 --write \"scripts/*.js\"",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"precommit": "lint-staged",
|
"precommit": "lint-staged",
|
||||||
"prettify": "prettier --trailing-comma all --write \"src/*.js\" \"scripts/*.js\" \"test/*.js\"",
|
|
||||||
"test": "npm run build && npm run test-only",
|
"test": "npm run build && npm run test-only",
|
||||||
"test-ci": "nyc npm run test",
|
"test-ci": "nyc npm run test",
|
||||||
"test-only": "mocha ./test --compilers js:babel-register -t 10000"
|
"test-only": "mocha ./test --compilers js:babel-register -t 10000"
|
||||||
@ -106,10 +106,14 @@
|
|||||||
"sourceMap": false
|
"sourceMap": false
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"{src,scripts}/**/*.js": [
|
"src/**/*.js": [
|
||||||
"prettier --trailing-comma all --write",
|
"prettier --trailing-comma all --write",
|
||||||
"git add"
|
"git add"
|
||||||
],
|
],
|
||||||
|
"scripts/*.js": [
|
||||||
|
"prettier --trailing-comma es5 --write",
|
||||||
|
"git add"
|
||||||
|
],
|
||||||
"test/*.js": [
|
"test/*.js": [
|
||||||
"prettier --trailing-comma all --write",
|
"prettier --trailing-comma all --write",
|
||||||
"git add"
|
"git add"
|
||||||
|
|||||||
@ -54,7 +54,7 @@ const envMap = {
|
|||||||
|
|
||||||
const invertedEqualsEnv = Object.keys(envs).filter(b => envs[b].equals).reduce((
|
const invertedEqualsEnv = Object.keys(envs).filter(b => envs[b].equals).reduce((
|
||||||
a,
|
a,
|
||||||
b,
|
b
|
||||||
) => {
|
) => {
|
||||||
const checkEnv = envMap[envs[b].equals] || envs[b].equals;
|
const checkEnv = envMap[envs[b].equals] || envs[b].equals;
|
||||||
environments.some(env => {
|
environments.some(env => {
|
||||||
@ -88,7 +88,7 @@ const compatibilityTests = flattenDeep(
|
|||||||
return test.subtests
|
return test.subtests
|
||||||
? [test, renameTests(test.subtests, name => test.name + " / " + name)]
|
? [test, renameTests(test.subtests, name => test.name + " / " + name)]
|
||||||
: test;
|
: test;
|
||||||
})),
|
}))
|
||||||
);
|
);
|
||||||
|
|
||||||
const getLowestImplementedVersion = ({ features }, env) => {
|
const getLowestImplementedVersion = ({ features }, env) => {
|
||||||
@ -115,7 +115,7 @@ const getLowestImplementedVersion = ({ features }, env) => {
|
|||||||
res: test.res,
|
res: test.res,
|
||||||
isBuiltIn,
|
isBuiltIn,
|
||||||
};
|
};
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const envTests = tests.map(({ res: test, name, isBuiltIn }, i) => {
|
const envTests = tests.map(({ res: test, name, isBuiltIn }, i) => {
|
||||||
@ -141,8 +141,7 @@ const getLowestImplementedVersion = ({ features }, env) => {
|
|||||||
.filter(t => t.startsWith(env))
|
.filter(t => t.startsWith(env))
|
||||||
// Babel assumes strict mode
|
// Babel assumes strict mode
|
||||||
.filter(
|
.filter(
|
||||||
test =>
|
test => tests[i].res[test] === true || tests[i].res[test] === "strict"
|
||||||
tests[i].res[test] === true || tests[i].res[test] === "strict",
|
|
||||||
)
|
)
|
||||||
// normalize some keys
|
// normalize some keys
|
||||||
.map(test => envMap[test] || test)
|
.map(test => envMap[test] || test)
|
||||||
@ -214,7 +213,7 @@ if (process.argv[2] === "--check") {
|
|||||||
) {
|
) {
|
||||||
console.error(
|
console.error(
|
||||||
"The newly generated plugin/built-in data does not match the current " +
|
"The newly generated plugin/built-in data does not match the current " +
|
||||||
"files. Re-run `npm run build-data`.",
|
"files. Re-run `npm run build-data`."
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -224,10 +223,10 @@ if (process.argv[2] === "--check") {
|
|||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
pluginsDataPath,
|
pluginsDataPath,
|
||||||
JSON.stringify(newPluginData, null, 2) + "\n",
|
JSON.stringify(newPluginData, null, 2) + "\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
builtInsDataPath,
|
builtInsDataPath,
|
||||||
JSON.stringify(newBuiltInsData, null, 2) + "\n",
|
JSON.stringify(newBuiltInsData, null, 2) + "\n"
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1843,11 +1843,7 @@ dom-serializer@0, dom-serializer@~0.1.0:
|
|||||||
domelementtype "~1.1.1"
|
domelementtype "~1.1.1"
|
||||||
entities "~1.1.1"
|
entities "~1.1.1"
|
||||||
|
|
||||||
domelementtype@1:
|
domelementtype@1, domelementtype@~1.1.1:
|
||||||
version "1.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2"
|
|
||||||
|
|
||||||
domelementtype@~1.1.1:
|
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"
|
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user