You can't run away
From these styles I got, oh baby, hey baby
Cause I got a lot, oh yeahThe Fugees - Ready or Not
Table of contents:
EditorConfig is used to define indentation style and size, EOL, final new line, charset across a single project.
EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
Be useful
Be detailed
Be consistent
Use the active voice
feature development encapsulated
leverage pull requests
master
develop
feature/
release/
hotfix/
Use Prettier:
npm i -D prettier
Editor | Plugin | Installation |
---|---|---|
Sublime Text | SublimeJsPrettier | Prettier via Package Manager |
Atom | prettier-atom | apm install prettier-atom |
VSCode | prettier-vscode | ext install prettier-vscode |
Prettier is an opinionated code formatter with support for:
Install the linter:
Install the linter's plugins:
Editor | Plugin | Installation |
---|---|---|
Sublime Text | SublimeLinter-eslint | SublimeLinter-contrib-eslint via Package Manager |
Atom | linter-eslint | apm install linter-eslint |
VSCode | vscode-eslint | ESLint from VS Code Marketplace |
Use ESLint:
npm i -D eslint
Configure ESLint for Prettier:
- Use eslint-plugin-prettier as an ESLint rule:
npm i -D eslint-plugin-prettier
{
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": "error"
},
}
- Use eslint-config-prettier to disable all the existing formatting rules:
npm i -D eslint-config-prettier
{
"extends": [
"prettier"
]
}
See package.json.
.u-utility
.ComponentName
.ComponentName-descendentName
.ComponentName--modifierName
.ComponentName.is-stateOfComponent
or sometimes BEM:
.block-name
.block-name__element
.block-name--modifier-name
Normalize.css makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing.
For Google Projects, use the following: