Pragmatic is a guide for writing clean, modern and problem-free JavaScript.
npm install pragmatic
All rules are documented in RULES.md. Pragmatic inherits from standard
style, but with significant differences. Some of the most important include:
- Semicolons are required
- Modern syntax is enforced
- Explicit loops are disallowed
- Optimization suggestions for regular expressions are provided
The easiest way to use this Pragmatic style checker is to install it globally.
npm install -g pragmatic
Once installed, simply run in your project directory with:
pragmatic
To automate the process, you can use Pragmatic style as part of your testing process.
npm install --save-dev pragmatic
Then in your package.json
:
{
"scripts": {
"test": "pragmatic && other-tests"
}
}
Pragmatic automatically ignores:
node_modules/**
*.min.js
bundle.js
coverage/**
.*
- Anything in
.gitignore
If you would like to ignore additional folders, add a pragmatic.ignore
property to package.json
:
{
"pragmatic": {
"ignore": [
"**/out/",
"tmp.js"
]
}
}
Copyright (c) 2019 Jade Michael Thornton
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
See LICENSE for more.