@mondra/code-format-config v2.0.0
Code Format Config
Linting rules for JavaScript, ReactJS and TypeScript project. This package provides some standard coding rules via ESLint and Prettier.
Installation
npm i @mondra/code-format-config --save-devUsage
In order to use this package for rules, one need to follow these steps:
- Install two VSCode extensions i.e.
dbaeumer.vscode-eslintandesbenp.prettier-vscode. - Install this package by following
Installationprocess mention above. - Create
.eslintrc.jsfile under root of your project. - Create
.prettierrc.jsfile under root of your project. - Type following code in both files mentioned below:
.eslintrc.js
module.exports = require('@mondra/code-format-config/eslint-config').prettierrc.js
module.exports = require('@mondra/code-format-config/prettier-config')Then finally, restart your VSCode IDE.
Additionally one can setup scripts under package.json
package.json
{
"scripts": {
"lint:fix": "eslint -c .eslintrc.js --ext .js,.jsx,.ts,.tsx --fix src/",
"prettier:fix": "prettier --config .prettierrc.js --write \"src/**/*.{js,jsx,ts,tsx}\"",
"formatter": "npm run prettier:fix && npm run lint:fix"
}
}Note: Mind the formatter sequence, i.e. first run Prettier and then ESLint.
In order to run and fix all lint errors in project, execute following command in terminal.
npm run formatterContribute
Only Mondra team members can contribute to development of this package.
Develop
- Clone components project from here - https://ProArchITSolutions@dev.azure.com/ProArchITSolutions/Mondra/_git/Mondra.CodeFormatConfig
npm installin the root directoy.- Checkout to your own branch
feature/<branch-name>orbug/<branch-name>frommainbranch. - Update the package.
- Update CHANGELOG.md
- Bump the version appropriately in
package.jsonX.X.X-Major.Minor.Patch - Once changes are committed, raise and complete the PR with title matching above version number.
- You're done. Next follow
buildprocess.
Build
Now main branch is upto the date as per latest features or bug fixes, execute following command in terminal.
npm publish- This will publish the latest version of the library into npmjs.com
License
See in LICENSE.md
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago