4.1.1 • Published 10 months ago

eslint-config-pureprofile v4.1.1

Weekly downloads
93
License
MIT
Repository
github
Last release
10 months ago

eslint-config-pureprofile

what is this?

this is compose config file for (usage of react plugins is autodetected based if a project has react installed in dependencies):

  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "plugins": ["@typescript-eslint"],
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "plugin:jest/recommended",
    "airbnb",
    "airbnb/hooks",
    "airbnb-typescript",
    "react-app",
    "react-app/jest",
    "prettier"
  ],

some rules were disabled because they did conflict with the way we write code, but not too many, please see index.js for details

how do i use this?

these will get you started:

npm uninstall --save is-ci husky lint-staged prettier pretty-quick eslint-config-pureprofile
npm install --save is-ci eslint-config-pureprofile
npm install --save-dev husky lint-staged prettier
npx json -I -f package.json -e "this.scripts.prepare=\"is-ci || husky install\""
npx json -I -f package.json -e "this.scripts.eslint=\"eslint --ext=ts,tsx --fix ./src\""
npx json -I -f package.json -e "this.scripts.prettier=\"prettier --write ./src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\""
npx json -I -f package.json -e "this.eslintConfig={\"extends\":\"pureprofile\",\"parserOptions\":{\"project\":\"./tsconfig.json\"}}"
npx json -I -f package.json -e "this.prettier=\"eslint-config-pureprofile/prettier-config\""
npx json -I -f package.json -e "this[\"lint-staged\"]={\"*.{ts,tsx}\":[\"eslint --fix\",\"prettier --write\"],\"*.{js,jsx,json,css,scss}\":[\"prettier --write\"]}"
npx json -I -f package.json -e "delete this.husky"
mkdir -p .husky
echo "_" > .husky/.gitignore
npx husky add ".husky/pre-commit"
sed -i 's/undefined/npx lint-staged/g' .husky/pre-commit
npx husky add ".husky/pre-push"
sed -i 's/undefined/npm run build/g' .husky/pre-push
npm run prepare

old approach (husky v4)

npm install --save eslint-config-pureprofile
npm install --save-dev husky@4 lint-staged prettier

and add these bits into your package.json:

"scripts": {
  "eslint": "eslint --ext=ts,tsx ./src",
},
"husky": {
  "hooks": {
    "pre-commit": "lint-staged",
    "pre-push": "npm run build && npm run eslint"
  }
},
"lint-staged": {
  "*.{ts,tsx}": [
    "eslint --ext=ts,tsx --fix",
    "prettier --write",
    "git add"
  ],
  "*.{js,jsx,json,css,scss}": [
    "prettier --write",
    "git add"
  ]
},
"eslintConfig": {
  "extends": "pureprofile",
  "parserOptions": { "project": "./tsconfig.json" }
},
"prettier": "eslint-config-pureprofile/prettier-config",
4.1.1

10 months ago

4.1.0

2 years ago

4.0.16

2 years ago

4.0.15

2 years ago

4.0.12

3 years ago

4.0.11

3 years ago

4.0.14

2 years ago

4.0.13

3 years ago

4.0.10

3 years ago

4.0.5

3 years ago

4.0.4

3 years ago

4.0.7

3 years ago

4.0.6

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.9

3 years ago

4.0.8

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.3.6

3 years ago

3.3.5

4 years ago

3.3.4

4 years ago

3.3.3

4 years ago

3.3.2

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.8

4 years ago

3.1.7

4 years ago

3.1.3

4 years ago

3.1.6

4 years ago

3.1.5

4 years ago

3.1.4

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.4.0

5 years ago

2.3.3

5 years ago

2.3.2

6 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.5

7 years ago

2.2.4

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago