Add strapi-lint to ctm plugin and modify monorepo setups script to install it.

Now the strapi-lint is installed in both the ctm and the helper-plugin. It will be installed in all plugins later.

Important the updated eslint configuration requires to modify a lot of files....
This commit is contained in:
soupette 2018-04-27 16:25:23 +02:00
parent 7867239557
commit 0ca85934ac
16 changed files with 32 additions and 45 deletions

View File

@ -52,4 +52,4 @@
"npm": ">= 5.0.0"
},
"license": "MIT"
}
}

View File

@ -21,6 +21,7 @@
"license": "MIT",
"scripts": {
"lint": "cross-env IS_HELPER=true ./node_modules/eslint/bin/eslint.js --ignore-path .gitignore --config ./lib/internals/eslint/eslint-config.js .",
"lintTocome": "cross-env IS_HELPER=true node ./node_modules/strapi-lint/node_modules/.bin/eslint --ignore-path .gitignore --config ./node_modules/strapi-lint/lib/internals/eslintFront/eslint-config.js .",
"prettier": "prettier --single-quote --trailing-comma es5 --write \"{lib,__{tests,mocks}__}/**/*.js\"",
"test": "npm run lint"
},
@ -108,6 +109,7 @@
"sass-loader": "^6.0.6",
"shelljs": "^0.7.8",
"showdown": "^1.8.6",
"strapi-lint": "3.0.0-alpha.12",
"style-loader": "^0.18.2",
"url-loader": "^0.5.9",
"webpack": "^3.5.5",

View File

@ -40,4 +40,4 @@
"dependencies": {
"babel-eslint": "^8.2.3"
}
}
}

View File

@ -1,27 +0,0 @@
/**
*
* Container
*
*/
import React from 'react';
import PropTypes from 'prop-types';
class Container extends React.Component {
render() {
return (
<div className={`container`}>
{this.props.children}
</div>
);
}
}
Container.propTypes = {
children: PropTypes.oneOfType([
PropTypes.object,
PropTypes.array,
]).isRequired,
};
export default Container;

View File

@ -1,2 +0,0 @@
.containerCustom { /* stylelint-disable */
}

View File

@ -39,7 +39,7 @@ function EmptyAttributesView({ currentModelName, history, modelEntries }) {
<Button
onClick={() => history.push(`/plugins/content-type-builder/models/${currentModelName}#choose::attributes`)}
primaryAddShape
label={'content-manager.emptyAttributes.button'}
label="content-manager.emptyAttributes.button"
/>
</div>
</div>

View File

@ -47,7 +47,7 @@ class TableHeader extends React.Component {
});
// Add empty th for actions column.
headers.push(<th key={`th_action`}></th>);
headers.push(<th key="th_action"></th>);
return (
<thead className={styles.tableHeader}>

View File

@ -108,9 +108,6 @@ TableRow.propTypes = {
TableRow.defaultProps = {
onDelete: () => {},
value: {
format: () => {},
},
};
export default TableRow;

View File

@ -248,7 +248,7 @@ export class ListPage extends React.Component {
cancel: 'content-manager.popUpWarning.button.cancel',
confirm: 'content-manager.popUpWarning.button.confirm',
}}
popUpWarningType={'danger'}
popUpWarningType="danger"
onConfirm={this.handleDelete}
/>
<PageFooter

View File

@ -1 +1,9 @@
{}
{
"yeryertt": {
"attributes": {
"yetryrte": {
"appearance": ""
}
}
}
}

View File

@ -17,14 +17,15 @@
"build:clean": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/rimraf admin/build",
"start": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=development PLUGIN=true node ./node_modules/strapi-helper-plugin/lib/server",
"generate": "node ./node_modules/plop/plop.js --plopfile ./node_modules/strapi-helper-plugin/lib/internals/generators/index.js",
"lint": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/eslint --ignore-path .gitignore --ignore-pattern '/admin/build/' --config ./node_modules/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json admin",
"lint": "node ./node_modules/strapi-lint/node_modules/.bin/eslint --ignore-path .gitignore --ignore-pattern '/admin/build/' --config ./node_modules/strapi-lint/lib/internals/eslintFront/.eslintrc.json admin",
"prettier": "node ./node_modules/strapi-helper-plugin/node_modules/.bin/prettier --single-quote --trailing-comma es5 --write \"{admin,__{tests,mocks}__}/**/*.js\"",
"test": "npm run lint",
"prepublishOnly": "npm run build"
},
"devDependencies": {
"react-select": "^1.0.0-rc.5",
"strapi-helper-plugin": "3.0.0-alpha.12"
"strapi-helper-plugin": "3.0.0-alpha.12",
"strapi-lint": "3.0.0-alpha.12"
},
"author": {
"name": "Strapi team",
@ -47,4 +48,4 @@
"npm": ">= 5.0.0"
},
"license": "MIT"
}
}

View File

@ -51,4 +51,4 @@
"npm": ">= 5.0.0"
},
"license": "MIT"
}
}

View File

@ -48,4 +48,4 @@
"npm": ">= 5.0.0"
},
"license": "MIT"
}
}

View File

@ -48,4 +48,4 @@
"npm": ">= 3.0.0"
},
"license": "MIT"
}
}

View File

@ -55,4 +55,4 @@
"npm": ">= 5.0.0"
},
"license": "MIT"
}
}

View File

@ -69,8 +69,12 @@ watcher('📦 Linking strapi-generate...', 'npm link');
shell.cd('../strapi-generate-api');
watcher('📦 Linking strapi-generate-api...', 'npm link');
shell.cd('../strapi-lint');
watcher('📦 Linking strapi-lint...', 'npm link');
shell.cd('../strapi-helper-plugin');
watcher('📦 Linking strapi-helper-plugin...', 'npm link');
watcher('', 'npm install ../strapi-lint --no-optional');
shell.cd('../strapi-admin');
watcher('', 'npm install ../strapi-helper-plugin --no-optional');
@ -85,6 +89,9 @@ if (shell.test('-e', 'admin/src/config/plugins.json') === false) {
shell.cd('../../../');
}
// TODO : install strapi-lint in all packages in async
watcher('📦 Linking strapi-admin', 'npm link --no-optional', false);
shell.cd('../strapi-generate-admin');
@ -127,6 +134,7 @@ watcher('📦 Linking strapi-plugin-users-permissions...', 'npm link --no-optio
shell.cd('../strapi-plugin-content-manager');
watcher('', 'npm install ../strapi-helper-plugin --no-optional');
watcher('', 'npm install ../strapi-lint --no-optional');
shell.rm('-f', 'package-lock.json');
watcher('📦 Linking strapi-plugin-content-manager...', 'npm link --no-optional', false);