skip folder w'o package.json; restrict linter to src folders
This commit is contained in:
+12
-3
@@ -22,9 +22,18 @@ if (fs.existsSync(addonsPath)) {
|
|||||||
const addonPath = path.join(addonsPath, folder);
|
const addonPath = path.join(addonsPath, folder);
|
||||||
|
|
||||||
// install only if there are dependencies listed
|
// install only if there are dependencies listed
|
||||||
const packageJson = require(path.join(addonPath, 'package.json'));
|
// also skip addon if it does not contain any package.json
|
||||||
if ((packageJson.devDependencies && Object.keys(packageJson.devDependencies).length)
|
// (might happen after branch switches)
|
||||||
|| (packageJson.dependencies && Object.keys(packageJson.dependencies).length))
|
let packageJson;
|
||||||
|
try {
|
||||||
|
packageJson = require(path.join(addonPath, 'package.json'));
|
||||||
|
} catch (e) {}
|
||||||
|
if (packageJson
|
||||||
|
&& (
|
||||||
|
(packageJson.devDependencies && Object.keys(packageJson.devDependencies).length)
|
||||||
|
|| (packageJson.dependencies && Object.keys(packageJson.dependencies).length)
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
console.log('Preparing', folder);
|
console.log('Preparing', folder);
|
||||||
if (hasYarn) {
|
if (hasYarn) {
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@
|
|||||||
"prepackage": "npm run build",
|
"prepackage": "npm run build",
|
||||||
"package": "webpack",
|
"package": "webpack",
|
||||||
"start": "node demo/start",
|
"start": "node demo/start",
|
||||||
"lint": "tslint 'src/**/*.ts' 'addons/**/*.ts'",
|
"lint": "tslint 'src/**/*.ts' 'addons/*/src/**/*.ts'",
|
||||||
"test": "npm run test-unit",
|
"test": "npm run test-unit",
|
||||||
"posttest": "npm run lint",
|
"posttest": "npm run lint",
|
||||||
"test-api": "mocha \"**/*.api.js\"",
|
"test-api": "mocha \"**/*.api.js\"",
|
||||||
|
|||||||
Reference in New Issue
Block a user