@mlaursen/eslint-config 1.2.0 → 1.5.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.
package/.env.github ADDED
@@ -0,0 +1 @@
1
+ GITHUB_TOKEN=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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.5.0](https://github.com/mlaursen/eslint-config/compare/v1.4.0...v1.5.0) (2022-03-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * force braces ([f6d3f69](https://github.com/mlaursen/eslint-config/commit/f6d3f69cb8644746f7db8e6d562fbdd3a20c8d19))
11
+ * Force consistent type imports for typescript 3.8 or greater ([880217f](https://github.com/mlaursen/eslint-config/commit/880217fb7ad258acc6601218bb649c0928d97ade))
12
+ * Upgrade eslint dependencies to latest ([7551d04](https://github.com/mlaursen/eslint-config/commit/7551d0457be41ca3844a35b45a1eb11b9a510ffc))
13
+
14
+ ## [1.4.0](https://github.com/mlaursen/eslint-config/compare/v1.3.0...v1.4.0) (2022-01-11)
15
+
16
+
17
+ ### Features
18
+
19
+ * **deps:** bump all dependencies to latest ([0e7b8f5](https://github.com/mlaursen/eslint-config/commit/0e7b8f5042d5b99bceaa47d10e0316496e857944))
20
+
21
+ ## [1.3.0](https://github.com/mlaursen/eslint-config/compare/v1.2.0...v1.3.0) (2022-01-01)
22
+
23
+
24
+ ### Features
25
+
26
+ * **deps:** bump all dependencies to latest ([f995232](https://github.com/mlaursen/eslint-config/commit/f99523225f5df1aa8e2af6540ffa8f3f07563df1))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * Add peerDependenciesMeta to package.json ([03dcd3d](https://github.com/mlaursen/eslint-config/commit/03dcd3da67cb751c53b8e4367188e4119f8b2e04))
32
+ * Update eslint peerDependency to require v8.0.0 ([c0a593e](https://github.com/mlaursen/eslint-config/commit/c0a593ea8b2ee26287d3f307915381d229ed526c))
33
+
5
34
  ## [1.2.0](https://github.com/mlaursen/eslint-config/compare/v1.1.8...v1.2.0) (2021-11-21)
6
35
 
7
36
 
package/index.js CHANGED
@@ -2,11 +2,21 @@ const confusingBrowserGlobals = require('confusing-browser-globals');
2
2
 
3
3
  let react = false;
4
4
  let isNewJsx = false;
5
+ let isTypescript38 = false;
5
6
  try {
6
7
  require.resolve('react');
7
8
  react = true;
8
9
  isNewJsx = parseInt(require('react').version, 10) > 16;
9
10
  } catch (e) {}
11
+ try {
12
+ const { version } = require('typescript');
13
+ const [majorString, minorString] = version.split('.');
14
+ const major = parseInt(majorString, 10);
15
+ const minor = parseInt(minorString, 10);
16
+ if (!Number.isNaN(major) && !Number.isNaN(minor)) {
17
+ isTypescript38 = major > 3 || (major === 3 && minor > 8);
18
+ }
19
+ } catch (e) {}
10
20
 
11
21
  module.exports = {
12
22
  parser: '@typescript-eslint/parser',
@@ -54,6 +64,8 @@ module.exports = {
54
64
 
55
65
  // too many false positives with aliases/root dirs
56
66
  'import/no-unresolved': 0,
67
+
68
+ curly: 'error',
57
69
  },
58
70
  overrides: [
59
71
  {
@@ -104,6 +116,10 @@ module.exports = {
104
116
  varsIgnorePattern: '^_',
105
117
  },
106
118
  ],
119
+
120
+ '@typescript-eslint/consistent-type-imports': isTypescript38
121
+ ? ['error']
122
+ : 'off',
107
123
  },
108
124
  },
109
125
  {
package/package.json CHANGED
@@ -1,34 +1,59 @@
1
1
  {
2
2
  "name": "@mlaursen/eslint-config",
3
- "version": "1.2.0",
3
+ "version": "1.5.0",
4
4
  "description": "An eslint config used by mlaursen for most projects.",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/mlaursen/eslint-config.git",
7
7
  "author": "Mikkel Laursen <mlaursen03@gmail.com>",
8
8
  "license": "MIT",
9
9
  "scripts": {
10
- "release": "standard-version && npm publish && git push --follow-tags origin main"
10
+ "test": "eslint -c index.js \"test/**/*.{js,jsx,ts,tsx}\"",
11
+ "run-script": "ts-node -T -P tsconfig.node.json",
12
+ "release": "yarn run-script scripts/release.ts"
11
13
  },
14
+ "bugs": {
15
+ "url": "https://github.com/mlaursen/eslint-config/issues"
16
+ },
17
+ "keywords": [
18
+ "eslint",
19
+ "typescript"
20
+ ],
12
21
  "dependencies": {
13
- "@typescript-eslint/eslint-plugin": "^5.4.0",
14
- "@typescript-eslint/parser": "^5.4.0",
15
- "confusing-browser-globals": "^1.0.9",
16
- "eslint-config-prettier": "^8.2.0",
17
- "eslint-plugin-import": "^2.25.3",
18
- "eslint-plugin-jest": "^25.2.4",
22
+ "@typescript-eslint/eslint-plugin": "^5.14.0",
23
+ "@typescript-eslint/parser": "^5.14.0",
24
+ "confusing-browser-globals": "^1.0.11",
25
+ "eslint-config-prettier": "^8.5.0",
26
+ "eslint-plugin-import": "^2.25.4",
27
+ "eslint-plugin-jest": "^26.1.1",
19
28
  "eslint-plugin-jsx-a11y": "^6.5.1",
20
- "eslint-plugin-react": "^7.27.1",
29
+ "eslint-plugin-react": "^7.29.3",
21
30
  "eslint-plugin-react-hooks": "^4.3.0",
22
31
  "eslint-plugin-tsdoc": "^0.2.14"
23
32
  },
24
33
  "devDependencies": {
25
34
  "@mlaursen/changelog-preset": "^1.1.0",
26
- "standard-version": "^9.3.2"
35
+ "@octokit/core": "^3.5.1",
36
+ "@types/inquirer": "^8.2.0",
37
+ "@types/node": "^17.0.21",
38
+ "dotenv": "^16.0.0",
39
+ "eslint": "^8.10.0",
40
+ "inquirer": "^8.2.1",
41
+ "standard-version": "^9.3.2",
42
+ "ts-node": "^10.7.0",
43
+ "typescript": "^4.6.2"
27
44
  },
28
45
  "peerDependencies": {
29
- "eslint": ">= 7.10.0",
46
+ "eslint": ">= 8.0.0",
30
47
  "typescript": ">= 4"
31
48
  },
49
+ "peerDependenciesMeta": {
50
+ "eslint": {
51
+ "optional": false
52
+ },
53
+ "typescript": {
54
+ "optional": true
55
+ }
56
+ },
32
57
  "publishConfig": {
33
58
  "access": "public"
34
59
  }
package/.prettierrc DELETED
@@ -1,9 +0,0 @@
1
- printWidth: 80
2
- trailingComma: es5
3
- overrides:
4
- - files: "*.{js,jsx,scss}"
5
- options:
6
- singleQuote: true
7
- - files: "*.md"
8
- options:
9
- proseWrap: always
package/.versionrc.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('@mlaursen/changelog-preset');
@@ -1,28 +0,0 @@
1
- const packageJson = require('./package.json');
2
- const {
3
- createConfig,
4
- defaultGetCommitType,
5
- } = require('@mlaursen/changelog-preset/createConfig');
6
-
7
- module.exports = createConfig({
8
- tokens: Array.from(
9
- new Set([
10
- ...Object.keys(packageJson.dependencies),
11
- ...Object.keys(packageJson.devDependencies),
12
- ])
13
- ),
14
- ignoreDeps: false,
15
- getCommitType: (commit) => {
16
- const { scope = '' } = commit;
17
- if (scope === 'deps') {
18
- return 'Dependencies';
19
- }
20
-
21
- if (scope === 'dev-deps') {
22
- // don't include dev-deps
23
- return '';
24
- }
25
-
26
- return defaultGetCommitType(commit);
27
- },
28
- });