mirror of
https://github.com/strapi/strapi.git
synced 2025-10-30 09:23:28 +00:00
Fix strapi-helper-lint
This commit is contained in:
parent
0b1241300c
commit
48a2afe6bd
@ -76,7 +76,6 @@
|
|||||||
"class-methods-use-this": 0,
|
"class-methods-use-this": 0,
|
||||||
"react/forbid-prop-types": 0,
|
"react/forbid-prop-types": 0,
|
||||||
"react/react-in-jsx-scope": 0,
|
"react/react-in-jsx-scope": 0,
|
||||||
"react/forbid-prop-types": 0,
|
|
||||||
"react/jsx-first-prop-new-line": [
|
"react/jsx-first-prop-new-line": [
|
||||||
2,
|
2,
|
||||||
"multiline"
|
"multiline"
|
||||||
|
|||||||
@ -6,7 +6,7 @@ const glob = require('glob');
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const listChangedFiles = require('../packages/strapi-lint/lib/internals/shared/listChangedFiles.js');
|
const listChangedFiles = require('../packages/strapi-lint/lib/internals/shared/listChangedFiles.js');
|
||||||
const changedFiles = listChangedFiles();
|
const changedFiles = listChangedFiles();
|
||||||
const { take } = require('lodash');
|
const { includes, take } = require('lodash');
|
||||||
|
|
||||||
const frontCmd =
|
const frontCmd =
|
||||||
'node ../../node_modules/strapi-lint/node_modules/.bin/eslint --ignore-path .gitignore --ignore-pattern \'/admin/build/\' --config ../../node_modules/strapi-lint/lib/internals/eslint/front/.eslintrc.json admin';
|
'node ../../node_modules/strapi-lint/node_modules/.bin/eslint --ignore-path .gitignore --ignore-pattern \'/admin/build/\' --config ../../node_modules/strapi-lint/lib/internals/eslint/front/.eslintrc.json admin';
|
||||||
@ -19,7 +19,8 @@ const backCmd =
|
|||||||
const watcher = (label, pckgName, type = 'front') => {
|
const watcher = (label, pckgName, type = 'front') => {
|
||||||
shell.echo(label);
|
shell.echo(label);
|
||||||
shell.cd(pckgName);
|
shell.cd(pckgName);
|
||||||
const cmd = pckgName === 'strapi-helper-plugin' ? helperCmd : `${frontCmd} && ${backCmd}`;
|
const cmd = includes(pckgName, 'strapi-helper-plugin') ? helperCmd : `${frontCmd} && ${backCmd}`;
|
||||||
|
|
||||||
const data = shell.exec(cmd, { silent: true });
|
const data = shell.exec(cmd, { silent: true });
|
||||||
shell.echo(chalk(eslintErrorsFormatter(data.stdout)));
|
shell.echo(chalk(eslintErrorsFormatter(data.stdout)));
|
||||||
shell.cd('../..');
|
shell.cd('../..');
|
||||||
@ -34,7 +35,7 @@ const files = glob
|
|||||||
.sync('**/*.js', { ignore: '**/node_modules/**' })
|
.sync('**/*.js', { ignore: '**/node_modules/**' })
|
||||||
.filter(f => changedFiles.has(f))
|
.filter(f => changedFiles.has(f))
|
||||||
.filter(
|
.filter(
|
||||||
package =>
|
package =>
|
||||||
!package.includes('README.md') &&
|
!package.includes('README.md') &&
|
||||||
!package.includes('strapi-middleware-views') &&
|
!package.includes('strapi-middleware-views') &&
|
||||||
!package.includes('strapi-lint') &&
|
!package.includes('strapi-lint') &&
|
||||||
@ -49,8 +50,9 @@ const files = glob
|
|||||||
return take(directoryArray, toTake).join('/');
|
return take(directoryArray, toTake).join('/');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
files
|
files
|
||||||
.filter((directory, index) => files.indexOf(directory) === index)
|
.filter((directory, index) => files.indexOf(directory) === index)
|
||||||
.forEach(package => {
|
.forEach(package => {
|
||||||
watcher(`Testing ${package}`, package);
|
watcher(`Testing ${package}`, package);
|
||||||
});
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user