4.2.0 • Published 5 months ago

@rockpack/codestyle v4.2.0

Weekly downloads
91
License
MIT
Repository
github
Last release
5 months ago

@rockpack/codestyle

@rockpack/codestyle is an efficiently customized Eslint with many best practice rules and additions.

@rockpack/codestyle this module is part of the Rockpack project. See more details on the official site.

Features:

Eslint configs:

  • TS support, pure JS support, React support
  • Prettier integrated
  • Eslint Config Recommended
  • Eslint React Recommended
  • Eslint Airbnb Base Config
  • Eslint Import Recommended
  • Eslint TS Recommended
  • Eslint Prettier Recommended
  • Eslint Perfectionist
  • Eslint Regexp
  • Eslint Sonarjs

Additional tools:

  • Stylelint
  • Commitlint
  • Prettier

Using

  1. Installation:
# NPM
npm install @rockpack/codestyle --save-dev

# YARN
yarn add @rockpack/codestyle --dev
  1. Make .eslintrc.js, .prettierrc in the root of project

  2. Put the code in .eslintrc.js

const { makeConfig } = require('@rockpack/codestyle');

module.exports = makeConfig();
  1. Put the code in .prettierrc
{
  "singleQuote": true,
  "trailingComma": "all",
  "useTabs": false,
  "semi": true,
  "bracketSpacing": true,
  "printWidth": 120,
  "endOfLine": "lf"
}

IDE Integration

We can set up our IDE to fix all lint rules and format code by Prettier.

Webstorm

Manual setup

  1. Open Preferences
  2. Find Node.js tab. Choice Node.js interpreter
  3. Find ESLint.
  • Set Manual Configuration and set folder to "node_modules/eslint" in your project
  • Set working directories to root of your project
  • Set path to your .eslintrc.js file
  • Select "Run eslint --fix on save"
  1. Find Prettier.
  • Set Prettier path
  • Select "On Reformat code action", "On save"

VSCode

Manual setup

  1. Set "Format on save"
  2. Set "Format on paste"

Configuration setup

mkdir .vscode && touch .vscode/settings.json

Then add settings:

{
  "editor.formatOnSave": true,
  "editor.formatOnPaste": true,
  "eslint.autoFixOnSave": true,
  "eslint.validate": [
    {
      "language": "javascript",
      "autoFix": true
    },
    {
      "language": "javascriptreact",
      "autoFix": true
    },
    {
      "language": "typescript",
      "autoFix": true
    },
    {
      "language": "typescriptreact",
      "autoFix": true
    }
  ],
  "tslint.enable": false
}

The MIT License

MIT

4.0.0

6 months ago

4.2.0

5 months ago

4.0.0-next.1

6 months ago

4.0.0-next.5

6 months ago

4.0.0-next.4

6 months ago

4.0.0-next.3

6 months ago

4.0.0-next.2

6 months ago

4.1.0

6 months ago

3.0.3

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.0-next.4

1 year ago

3.0.0-next.5

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

3.0.0-next.2

2 years ago

3.0.0-next.1

2 years ago

3.0.0-next.3

2 years ago

2.0.0-rc.35

2 years ago

2.0.0-rc.36

2 years ago

2.0.0-rc.33

2 years ago

2.0.0-rc.34

2 years ago

2.0.0-rc.31

2 years ago

2.0.0-rc.32

2 years ago

2.0.1

2 years ago

2.0.0-rc.30

2 years ago

2.0.0-rc.29

2 years ago

2.0.0-rc.28

3 years ago

2.0.0-rc.27

3 years ago

2.0.0-rc.26

3 years ago

2.0.0-rc.24

3 years ago

2.0.0-rc.25

3 years ago

2.0.0-rc.23

3 years ago

2.0.0-rc.22

3 years ago

2.0.0-rc.21

3 years ago

2.0.0-rc.20

3 years ago

2.0.0-rc.19

3 years ago

2.0.0-rc.18

3 years ago

2.0.0-rc.17

3 years ago

2.0.0-rc.16

3 years ago

2.0.0-rc.15

3 years ago

2.0.0-rc.13

3 years ago

2.0.0-rc.14

3 years ago

2.0.0-rc.11

3 years ago

2.0.0-rc.12

3 years ago

2.0.0-rc.10

3 years ago

2.0.0-rc.9

3 years ago

2.0.0-rc.8

3 years ago

2.0.0-rc.7

3 years ago

2.0.0-rc.6

3 years ago

2.0.0-rc.5

3 years ago

2.0.0-rc.4

3 years ago

2.0.0-rc.3

3 years ago

2.0.0-rc.2

3 years ago

2.0.0-rc.1

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.1.0

3 years ago

1.0.0

4 years ago

0.9.9-rc.22

4 years ago

0.9.9-rc.21

4 years ago

0.9.9-rc.20

4 years ago

0.9.9-rc.19

4 years ago

0.9.9-rc.18

4 years ago

0.9.9-rc.17

4 years ago

0.9.9-rc.16

4 years ago

0.9.9-rc.15

4 years ago

0.9.9-rc.14

4 years ago

0.9.9-rc.13

4 years ago

0.9.9-rc.12

4 years ago

0.9.9-rc.11

4 years ago

0.9.9-rc.10

4 years ago

0.9.9-rc.9

4 years ago

0.9.9-rc.8

4 years ago

0.9.9-rc.7

4 years ago

0.9.9-rc.6

4 years ago

0.9.9-rc.5

4 years ago

0.9.9-rc.3

4 years ago

0.9.9-rc.2

4 years ago

0.9.9

4 years ago

0.9.0

4 years ago