1.0.0 • Published 2 years ago
@amjs/js-fw v1.0.0
@amjs/js-fw
Framework tools to work in any CJS source code.
What's included:
- Default configuration for BabelJS.
- Unitary testing solution with Jest.
- Default configuration with EslintJS for linting any
*.m?jssource code.
NOTICE: The linting configuration is strongly opinionated.
Checkout configuration at .estlintrc.js file.
Installation
npm i --save-dev @amjs/js-fwAdd this to your package.json scripts:
{
"scripts": {
"test": "NODE_ENV=test node node_modules/@amjs/js-fw/scripts/test",
"lint:js:check": "node node_modules/@amjs/js-fw/scripts/lint",
"lint:js:fix": "node node_modules/@amjs/js-fw/scripts/lint -- --fix"
}
}How to extend default configurations
In your project root folder you can extend locally any of provided .babelrc.js, .eslintrc.js or jest.config.js
configuration files.
In the following example you can see how to override the semi
rule of Eslint, for example:
// at your local ".eslintrc.js" file
const defaultConfig = require('@amjs/js-fw/.eslintrc.js');
defaultConfig.rules.semi = 0;
module.exports = defaultConfig;- Use estlinjs documenation to explore rules in order to configure at your project.
- Use jest.io configuration to explore how to configure
Jest. - Use babeljs documentation to explore how to configure
BabelJS.
1.0.0
2 years ago