0.1.24 • Published 20 days ago

@wttsolutions/eslint-config v0.1.24

Weekly downloads
-
License
MIT
Repository
github
Last release
20 days ago

n# Centralized eslint (+react), prettier, typescript configs

Setup

yarn add --dev @wttsolutions/eslint-config@^0.1

// reivew & install project peer dependencies (eslint, react, prettier, typescript...)
npx check-peer-dependencies --findSolutions

Create .eslintrc.js:

module.exports = {
  "extends": [
    "@wttsolutions/eslint-config",
    //optional "@wttsolutions/eslint-config/.eslintrc-react.js",
    //optional "@wttsolutions/eslint-config/.eslintrc-ts.js"
  ],
  rules: {
    // "no-var": "off"
  }
}

(Optional) Create prettier.config.js:

module.exports = {
  ...require('@wttsolutions/eslint-config/prettier.config.js'),

  // custom rules
  // singleQuote: false,
}

(Optional) Create tsconfig.json with custom options:

{
  "extends": "./node_modules/@wttsolutions/eslint-config/tsconfig.json",

  "compilerOptions": {
    "removeComments": false
  }
}

Note: extends works via local path only because of bug in ts

Modify the package.json according project requirements:

...
"scripts": {
  ...
  "prettify": "prettier --check src/**/*.{js,jsx,ts,tsx}",
  "prettify:fix": "prettier --write src/**/*.{js,jsx,ts,tsx}",
  "lint": "eslint src",
  "lint:fix": "eslint --fix src"
}
...

Configure your code editor to make him automatically prettify and lint code by the .eslintrc.js and prettier.config.js configs. Assummed that you shouldn't run linting scripts manually in most cases.

UPDATING THIS PACKAGE (internal)

1. Login to npm

Make sure you have wright permissions to the https://github.com/wttsolutions/eslint-config repository and your npmjs.com acccount included into the npmjs.com -> wttsolutions -> develpers team members.

yarn login

2. Update package & version

yarn version:patch
git commit ....
git push
yarn publ

Note: when running yarn publ DON'T modify the version (it's already updated by yarn version:patch

How it works

  1. prettier formats code
  2. eslint applies linting rules to code
  3. developer see the remained eslint errors in the code editor and fix them manually

TODO

Note

using eslint & typescript as OWN dependencies (not peer) to make this package works more independently from project where it would be used & keep all plugins compatible

0.1.24

20 days ago

0.1.20

21 days ago

0.1.21

21 days ago

0.1.22

21 days ago

0.1.23

21 days ago

0.1.11

1 month ago

0.1.10

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.9

4 months ago

0.1.6

4 months ago

0.1.0

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.5

4 months ago

0.0.54

1 year ago

0.0.52

2 years ago

0.0.49

2 years ago

0.0.48

2 years ago

0.0.47

2 years ago

0.0.41

2 years ago

0.0.40

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.21

2 years ago

0.0.19

2 years ago

0.0.17

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago