@newhighsco/eslint-config 2.3.61 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +6 -11
  2. package/index.js +36 -1
  3. package/package.json +16 -11
  4. package/react.js +0 -17
package/README.md CHANGED
@@ -23,11 +23,14 @@ New High Score ESLint rules come bundled in `@newhighsco/eslint-config`. To enab
23
23
  }
24
24
  ```
25
25
 
26
- ### React
26
+ ### Typescript
27
27
 
28
28
  ```json
29
29
  "eslintConfig": {
30
- "extends": ["@newhighsco/eslint-config/react"]
30
+ "extends": ["@newhighsco"],
31
+ "parserOptions": {
32
+ "project": "tsconfig.json"
33
+ }
31
34
  }
32
35
  ```
33
36
 
@@ -35,19 +38,11 @@ Now you can run ESLint by adding the following scripts to your `package.json`. S
35
38
 
36
39
  ```json
37
40
  "scripts": {
38
- "lint:js": "eslint --cache --ignore-path .gitignore --ext .js,.json .",
41
+ "lint:js": "eslint --cache --ignore-path .gitignore --ext .js,.json,.jsx,.mdx .",
39
42
  "format:js": "yarn lint:js --fix"
40
43
  }
41
44
  ```
42
45
 
43
- ### React
44
-
45
- ```json
46
- "scripts": {
47
- "lint:js": "eslint --cache --ext .js,.json,.jsx,.mdx .",
48
- }
49
- ```
50
-
51
46
  Lint it:
52
47
 
53
48
  ```
package/index.js CHANGED
@@ -9,6 +9,41 @@ module.exports = {
9
9
  extends: ['standard', 'plugin:prettier/recommended'],
10
10
  plugins: ['json-format'],
11
11
  settings: {
12
+ 'json/json-with-comments-files': [],
12
13
  'json/sort-package-json': false
13
- }
14
+ },
15
+ overrides: [
16
+ // Typescript
17
+ {
18
+ files: ['*.ts?(x)'],
19
+ extends: ['standard-with-typescript', 'plugin:prettier/recommended'],
20
+ plugins: ['tsc'],
21
+ rules: {
22
+ 'tsc/config': [
23
+ 'error',
24
+ {
25
+ configFile: 'tsconfig.json'
26
+ }
27
+ ]
28
+ }
29
+ },
30
+ // React
31
+ {
32
+ files: ['*.{js,ts,md}x'],
33
+ env: {
34
+ browser: true
35
+ },
36
+ extends: [
37
+ 'standard-react',
38
+ 'standard-jsx',
39
+ 'plugin:prettier/recommended',
40
+ 'plugin:jsx-a11y/recommended',
41
+ 'plugin:mdx/recommended'
42
+ ],
43
+ rules: {
44
+ // Overrides standard-react
45
+ 'jsx-quotes': ['error', 'prefer-double']
46
+ }
47
+ }
48
+ ]
14
49
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@newhighsco/eslint-config",
3
3
  "description": "New High Score shareable config for ESLint",
4
- "version": "2.3.61",
4
+ "version": "3.1.1",
5
5
  "author": "New High Score <hello@newhighsco.re>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -14,24 +14,24 @@
14
14
  },
15
15
  "main": "index.js",
16
16
  "scripts": {
17
+ "prepare": "husky install",
17
18
  "test": "yarn lint",
18
19
  "lint": "npm-run-all --parallel lint:*",
19
- "lint:js": "eslint --ignore-path .gitignore --ext .js,.json .",
20
- "lint:jsx": "yarn lint:js --ext .js,.json,.jsx,.mdx --config ./react.js",
20
+ "lint:js": "eslint --ignore-path .gitignore --ext .js,.json,.jsx,.mdx,.ts,.tsx .",
21
21
  "format": "npm-run-all --parallel format:*",
22
- "format:js": "yarn lint:js --fix",
23
- "format:jsx": "yarn lint:jsx --fix"
22
+ "format:js": "yarn lint:js --fix"
24
23
  },
25
- "files": [
26
- "react.js"
27
- ],
24
+ "files": [],
28
25
  "dependencies": {
29
- "@babel/core": "7.17.0",
26
+ "@babel/core": "7.17.2",
30
27
  "@babel/eslint-parser": "7.17.0",
28
+ "@typescript-eslint/eslint-plugin": "5.11.0",
29
+ "@typescript-eslint/parser": "5.11.0",
31
30
  "eslint-config-prettier": "8.3.0",
32
31
  "eslint-config-standard": "16.0.3",
33
32
  "eslint-config-standard-jsx": "10.0.0",
34
33
  "eslint-config-standard-react": "11.0.1",
34
+ "eslint-config-standard-with-typescript": "21.0.1",
35
35
  "eslint-plugin-import": "2.25.4",
36
36
  "eslint-plugin-json-format": "2.0.1",
37
37
  "eslint-plugin-jsx-a11y": "6.5.1",
@@ -40,7 +40,8 @@
40
40
  "eslint-plugin-prettier": "4.0.0",
41
41
  "eslint-plugin-promise": "6.0.0",
42
42
  "eslint-plugin-react": "7.28.0",
43
- "eslint-plugin-standard": "4.1.0"
43
+ "eslint-plugin-standard": "4.1.0",
44
+ "eslint-plugin-tsc": "2.0.0"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@commitlint/cli": "16.1.0",
@@ -48,6 +49,7 @@
48
49
  "@newhighsco/editor-config": "1.1.2",
49
50
  "@newhighsco/prettier-config": "2.0.16",
50
51
  "@newhighsco/release-config": "1.1.5",
52
+ "@types/react": "17.0.39",
51
53
  "eslint": "8.8.0",
52
54
  "husky": "7.0.4",
53
55
  "npm-run-all": "4.1.5",
@@ -67,7 +69,10 @@
67
69
  ]
68
70
  },
69
71
  "eslintConfig": {
70
- "extends": "."
72
+ "extends": ".",
73
+ "parserOptions": {
74
+ "project": "tsconfig.json"
75
+ }
71
76
  },
72
77
  "husky": {
73
78
  "hooks": {
package/react.js DELETED
@@ -1,17 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true
4
- },
5
- extends: [
6
- '.',
7
- 'standard-react',
8
- 'standard-jsx',
9
- 'plugin:prettier/recommended',
10
- 'plugin:jsx-a11y/recommended',
11
- 'plugin:mdx/recommended'
12
- ],
13
- rules: {
14
- // Overrides standard-react
15
- 'jsx-quotes': ['error', 'prefer-double']
16
- }
17
- }