This contains our Assets Linting Rules
npm install lint-rules

This project houses all the linting rules for Market America | Shop.com
All config packages should always be use with
prettier which is an opinionated code formatter
that makes our code formatting consistent without having to be nitpicky on PRs.
This helps the person reviewing code concentrate on what the code is doing and
not how the code is formatted.
We use prettier-eslint-cli
to run prettier which will run prettier, theneslint --fix
We also use
prettier-stylelint-formatter
to run prettier which will run prettier withstylelint
#### npm
``bash`
npm install prettier-eslint-cli prettier-stylelint-formatter --save-dev
#### yarn
`bash`
yarn add prettier-eslint-cli prettier-stylelint-formatter --dev
All the commands should be the same on each project for formatting code with
prettier, and for linting code with
stylelint, and eslint. Copy and
paste the following commands into your project and remove lint-style if it's
not needed.
`makefileformats and lints all the files
lint:
@make lint-js lint-style lint-json lint-md --jobs
$3
Linting staged files is the easiest way to fix linting errors before it gets to
a pull request this keeps all the code consistent. We currently use
husky for a pre commit hook, and
lint-staged to pull the files that
are staged for the commit.
#### npm
`bash
npm install husky lint-staged --save-dev
`#### yarn
`bash
yarn add husky lint-staged --dev
`$3
Your
package.json file should have these configs inside of them. There
shouldn't be a separate config file for each of these since all that does is
just add clutter`json
{
"scripts": {
"precommit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx}": ["prettier-eslint --write", "eslint --fix", "git add"],
"*.scss": [
"prettier --parser scss --single-quote --write",
"stylelint --fix",
"git add"
],
"*.md": ["prettier --parser markdown --single-quote --write", "git add"],
"*.json": ["prettier --parser json --write", "git add"]
},
"eslintConfig": {
"extends": ["ma-shop"]
},
"stylelint": {
"extends": ["stylelint-config-ma-shop"]
},
"prettier": {
"singleQuote": true,
"trailingComma": "all",
"semi": false,
"arrowParens": "always"
}
}
`Contributing
To start contributing just fork/clone this repo and run
make install` to