1.1.1 • Published 6 years ago
@tiendeo/content-lint v1.1.1
tiendeo-lint
Installation
1. Install @tiendeo/content-lintpackage:
npm i -D @tiendeo/content-lint
2. Add these lines to package.json:
"eslintConfig": {
   "extends": ["./node_modules/@tiendeo/content-lint/.eslintrc.js"]
 },
 "stylelint": {
   "extends": "./node_modules/@tiendeo/content-lint/stylelint.config.js"
 },
Usage
1. Add these scripts to the package.json:
"eslint": "./node_modules/.bin/eslint \"src/**/*.{js,jsx}\"",
"stylelint": "./node_modules/.bin/stylelint \"src/**/*.{js,jsx}\"",
"format": "npm run prettier -- --write",
"prettier": "./node_modules/.bin/prettier \"src/**/*.{js,jsx,css,json}\" --config ./node_modules/@tiendeo/content-lint/.prettierrc.js"Optional:
If your project don't use Webpack, you may encounter conflicts with some routes, there is a script to fix that, also in package.json:
"removeWebpackLint": "node ./node_modules/@tiendeo/content-lint/scripts/removeWebpackLint.js"
Lint JS files
$ npm run eslint [options]
Fix JS files
$ npm run eslint -- --fix [options]
Format JS files
$ npm run format [options]
Lint Styled-Components
$ npm run stylelint [options]
Fix Styled-Components
$ npm run stylelint -- --fix [options]