1.0.0 • Published 11 months ago

@amjs/js-fw v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@amjs/js-fw

version

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?js source code.

NOTICE: The linting configuration is strongly opinionated.

Checkout configuration at .estlintrc.js file.

Installation

npm i --save-dev @amjs/js-fw

Add 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;