2.1.3 • Published 2 months ago

@spyrosoft/spyro-eslint-plugin v2.1.3

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

Spyrosoft ESlint Plugin

Nx plugin for setting up ESlint & Prettier in your monorepo.

Table of Contents

Requirements

This plugin can only be installed in an already existing Nx monorepo. Nx version 16.3.2 or higher is required.

Usage

First, install this plugin in your monorepo as a dev dependency:

npm i @spyrosoft/spyro-eslint-plugin --save-dev

Then, run the setup generator:

nx g @spyrosoft/spyro-eslint-plugin:setup

A couple of questions will be prompted to you. Once you answer all of them, the plugin will setup our eslint config in your monorepo.

If you wish to run the generator without having to answer prompted question, you can provide all necessary information as a command line arguments:

  • extend - extend your ESlint config with our rules, or overwrite it true | false

If true, it will simply add our config package to an already existing config, e.g.

{
  ...some other config,
  "extends": [...some other packages, "@spyrosoft/eslint-config-spyro"]
}

If false, it will replace the entire .eslintrc.json file content so that our config is the only source of rules:

{
  "extends": ["@spyrosoft/eslint-config-spyro"]
}
  • appName - name of your project (optional)
  • framework - framework used to create your project angular | react | next

The appName and framework parameters are used for overwriting files generated by Nx which are not compliant with our ESlint rules and not autofixable by linters. If you want to install this plugin in an already existing and modified workspace, it is not recommendend to use those arguments as your current work might be lost.

Example

npx nx g @spyrosoft/spyro-eslint-plugin:setup --appName=spyro-app --framework=angular --extend=false

ESlint rules

All ESlint rules are maintained in the form of npm package, you can find a full list here.

Prettier rules

A full list of applied prettier rules:

RuleDescription
printWidthline length that the printer will wrap on, set to 120
semiprint semicolons at the ends of statements
singleQuoteuse single quotes instead of double quotes
jsxSingleQuoteuse single quotes instead of double quotes in JSX
trailingCommatrailing commas where valid in ES5
useTabsfalse, indent lines with spaces instead of tabs
tabWidthnumber of spaces per indentation-level, set to 2
bracketSpacingprint spaces between brackets in object literals
2.1.2

2 months ago

2.1.1

2 months ago

2.1.3

2 months ago

2.1.0

3 months ago

2.0.1

3 months ago

1.1.1

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

1.8.0

8 months ago

1.7.0

8 months ago

1.6.0

8 months ago

1.5.0

8 months ago

1.3.2

8 months ago

1.4.0

8 months ago

1.2.1

8 months ago

0.0.16

11 months ago

0.0.15

11 months ago

0.0.14

11 months ago

0.0.13

11 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago