0.1.0 • Published 9 months ago

eslint-plugin-nullstack v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

eslint-plugin-nullstack

ESLint plugin + shareable config for the Nullstack framework

Installation

# npm
$ npm add -D eslint-plugin-nullstack

# yarn
$ yarn add -D eslint-plugin-nullstack

Usage

Once the eslint-plugin-nullstack package is installed, you can use it by specifying plugin:nullstack/recommended in the extends section of your ESLint configuration

// .eslintrc

{
  "extends": "plugin:nullstack/recommended"
}
// package.json

"scripts": {
  "lint": "eslint \"**/*.{js,jsx,ts,tsx,njs,nts}\" --fix"
}
// vscode - settings.json

{
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}

You can override prettier's default settings by updating the nullstack/prettier rule

// .eslintrc

{
  "extends": "plugin:nullstack/recommended",
  "rules": {
    "nullstack/prettier": [
      "warn",
      {
        "trailingComma": "all",
        "tabWidth": 2,
        "semi": false,
        "singleQuote": true,
        "printWidth": 120
      },
      {
        "usePrettierrc": false
      }
    ]
  }
}

IMPORTANT: Do not use Prettier Formatter for Visual Studio Code as this plugin uses a custom prettier implementation based on eslint-plugin-prettier

About

Main features:

  • Recommended rules to help find possible logical errors in code
  • Automatic organize imports
  • Automatic remove unused imports
  • Automatic code formatting (custom prettier implementation)

This plugin is based on the following plugins and configurations:

Nullstack rules: