@mondra/code-format-config
v1.1.0
Published
Linting rules for JavaScript, ReactJS and TypeScript project
Downloads
640
Readme
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-dev
Usage
In order to use this package for rules, one need to follow these steps:
- Install two VSCode extensions i.e.
dbaeumer.vscode-eslint
andesbenp.prettier-vscode
. - Install this package by following
Installation
process mention above. - Create
.eslintrc.js
file under root of your project. - Create
.prettierrc.js
file 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 formatter
Contribute
Only Mondra team members can contribute to development of this package.
Develop
- Clone components project from here - https://[email protected]/ProArchITSolutions/Mondra/_git/Mondra.CodeFormatConfig
npm install
in the root directoy.- Checkout to your own branch
feature/<branch-name>
orbug/<branch-name>
frommain
branch. - Update the package.
- Update CHANGELOG.md
- Bump the version appropriately in
package.json
X.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
build
process.
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