@newhighsco/eslint-config 2.3.62 → 3.1.2

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 +48 -3
  3. package/package.json +9 -12
  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
@@ -1,14 +1,59 @@
1
1
  module.exports = {
2
- parser: '@babel/eslint-parser',
3
2
  parserOptions: {
4
3
  requireConfigFile: false
5
4
  },
6
5
  env: {
7
6
  jest: true
8
7
  },
9
- extends: ['standard', 'plugin:prettier/recommended'],
8
+ extends: ['standard-with-typescript', 'plugin:prettier/recommended'],
10
9
  plugins: ['json-format'],
11
10
  settings: {
11
+ 'json/json-with-comments-files': [],
12
12
  'json/sort-package-json': false
13
- }
13
+ },
14
+ overrides: [
15
+ // Typescript
16
+ {
17
+ files: ['*.ts?(x)'],
18
+ parserOptions: {
19
+ project: './tsconfig.json'
20
+ },
21
+ plugins: ['tsc'],
22
+ rules: {
23
+ 'tsc/config': [
24
+ 'error',
25
+ {
26
+ configFile: './tsconfig.json'
27
+ }
28
+ ],
29
+ // Overrides standard-with-typescript
30
+ '@typescript-eslint/consistent-type-assertions': [
31
+ 'error',
32
+ {
33
+ assertionStyle: 'as',
34
+ objectLiteralTypeAssertions: 'allow'
35
+ }
36
+ ],
37
+ '@typescript-eslint/strict-boolean-expressions': 'off'
38
+ }
39
+ },
40
+ // React
41
+ {
42
+ files: ['*.{js,ts,md}x'],
43
+ env: {
44
+ browser: true
45
+ },
46
+ extends: [
47
+ 'standard-react',
48
+ 'standard-jsx',
49
+ 'plugin:prettier/recommended',
50
+ 'plugin:jsx-a11y/recommended',
51
+ 'plugin:mdx/recommended'
52
+ ],
53
+ rules: {
54
+ // Overrides standard-react
55
+ 'jsx-quotes': ['error', 'prefer-double']
56
+ }
57
+ }
58
+ ]
14
59
  }
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.62",
4
+ "version": "3.1.2",
5
5
  "author": "New High Score <hello@newhighsco.re>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -14,24 +14,20 @@
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.2",
30
- "@babel/eslint-parser": "7.17.0",
26
+ "@typescript-eslint/eslint-plugin": "5.11.0",
31
27
  "eslint-config-prettier": "8.3.0",
32
- "eslint-config-standard": "16.0.3",
33
28
  "eslint-config-standard-jsx": "10.0.0",
34
29
  "eslint-config-standard-react": "11.0.1",
30
+ "eslint-config-standard-with-typescript": "21.0.1",
35
31
  "eslint-plugin-import": "2.25.4",
36
32
  "eslint-plugin-json-format": "2.0.1",
37
33
  "eslint-plugin-jsx-a11y": "6.5.1",
@@ -40,7 +36,7 @@
40
36
  "eslint-plugin-prettier": "4.0.0",
41
37
  "eslint-plugin-promise": "6.0.0",
42
38
  "eslint-plugin-react": "7.28.0",
43
- "eslint-plugin-standard": "4.1.0"
39
+ "eslint-plugin-tsc": "2.0.0"
44
40
  },
45
41
  "devDependencies": {
46
42
  "@commitlint/cli": "16.1.0",
@@ -48,6 +44,7 @@
48
44
  "@newhighsco/editor-config": "1.1.2",
49
45
  "@newhighsco/prettier-config": "2.0.16",
50
46
  "@newhighsco/release-config": "1.1.5",
47
+ "@types/react": "17.0.39",
51
48
  "eslint": "8.8.0",
52
49
  "husky": "7.0.4",
53
50
  "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
- }