@newhighsco/eslint-config 2.3.60 → 3.1.0

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 +1 -17
  2. package/index.js +39 -1
  3. package/package.json +13 -11
  4. package/react.js +0 -17
package/README.md CHANGED
@@ -23,31 +23,15 @@ New High Score ESLint rules come bundled in `@newhighsco/eslint-config`. To enab
23
23
  }
24
24
  ```
25
25
 
26
- ### React
27
-
28
- ```json
29
- "eslintConfig": {
30
- "extends": ["@newhighsco/eslint-config/react"]
31
- }
32
- ```
33
-
34
26
  Now you can run ESLint by adding the following scripts to your `package.json`. See the [ESLint CLI docs](https://eslint.org/docs/user-guide/command-line-interface) for more details.
35
27
 
36
28
  ```json
37
29
  "scripts": {
38
- "lint:js": "eslint --cache --ignore-path .gitignore --ext .js,.json .",
30
+ "lint:js": "eslint --cache --ignore-path .gitignore --ext .js,.json,.jsx,.mdx .",
39
31
  "format:js": "yarn lint:js --fix"
40
32
  }
41
33
  ```
42
34
 
43
- ### React
44
-
45
- ```json
46
- "scripts": {
47
- "lint:js": "eslint --cache --ext .js,.json,.jsx,.mdx .",
48
- }
49
- ```
50
-
51
35
  Lint it:
52
36
 
53
37
  ```
package/index.js CHANGED
@@ -9,6 +9,44 @@ 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
+ parserOptions: {
20
+ project: 'tsconfig.json'
21
+ },
22
+ extends: ['standard-with-typescript', 'plugin:prettier/recommended'],
23
+ plugins: ['tsc'],
24
+ rules: {
25
+ 'tsc/config': [
26
+ 'error',
27
+ {
28
+ configFile: 'tsconfig.json'
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ // React
34
+ {
35
+ files: ['*.{js,ts,md}x'],
36
+ env: {
37
+ browser: true
38
+ },
39
+ extends: [
40
+ 'standard-react',
41
+ 'standard-jsx',
42
+ 'plugin:prettier/recommended',
43
+ 'plugin:jsx-a11y/recommended',
44
+ 'plugin:mdx/recommended'
45
+ ],
46
+ rules: {
47
+ // Overrides standard-react
48
+ 'jsx-quotes': ['error', 'prefer-double']
49
+ }
50
+ }
51
+ ]
14
52
  }
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.60",
4
+ "version": "3.1.0",
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.16.12",
30
- "@babel/eslint-parser": "7.16.5",
26
+ "@babel/core": "7.17.2",
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",
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
- }