1.1.0 • Published 6 months ago

style-lint-js v1.1.0

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

Style Lint JS

Installs and configure default linter and style checker for javascript and/or typescript projects.

Using ESLint and Prettier with default rules and as seen here:

ESLint rules:

Prettier rules

Install

To generate default config files in your project, run

npx style-lint-js init

# OR for typescript projects

npx style-lint-js init-ts

Once installed, you can run eslint or prettier commands as normal ie npx eslint file-to-lint.js or add to your package.json script.

Note: When initialising for typescript projects, you will need to have typescript installed already in your project for the typescript eslint rules to work.

Additional Rules or Override

Update the rc file to add or override default rules.

ie

const rules = require('style-lint-js/.eslintrc');

rules.rules = {
  ...rules.rules,
  ...{
    'import/newline-after-import': 'error',
  }
}

module.exports = rules;