@metamask/eslint-config-typescript 11.0.0 → 11.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [11.1.0]
10
+ ### Changed
11
+ - Exclude test files from package ([#266](https://github.com/MetaMask/eslint-config/pull/266))
12
+
13
+ ## [11.0.2]
14
+ ### Changed
15
+ - Allow async functions without any 'await' ([#262](https://github.com/MetaMask/eslint-config/pull/262))
16
+ - Allow parameters to use PascalCase ([#264](https://github.com/MetaMask/eslint-config/pull/264))
17
+
9
18
  ## [11.0.0]
10
19
  ### Added
11
20
  - **BREAKING:** Add rules that require type information ([#250](https://github.com/MetaMask/eslint-config/pull/250))
@@ -84,7 +93,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
84
93
  - To continue extending this config, install this package and update your `.eslintrc.js` `extends` array to include `@metamask/eslint-config-typescript` instead of `@metamask/eslint-config/typescript`.
85
94
  - Update `eslint` and other ESLint peer dependencies ([#151](https://github.com/MetaMask/eslint-config/pull/151))
86
95
 
87
- [Unreleased]: https://github.com/MetaMask/eslint-config/compare/v11.0.0...HEAD
96
+ [Unreleased]: https://github.com/MetaMask/eslint-config/compare/v11.1.0...HEAD
97
+ [11.1.0]: https://github.com/MetaMask/eslint-config/compare/v11.0.2...v11.1.0
98
+ [11.0.2]: https://github.com/MetaMask/eslint-config/compare/v11.0.0...v11.0.2
88
99
  [11.0.0]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...v11.0.0
89
100
  [10.0.0]: https://github.com/MetaMask/eslint-config/compare/v9.0.1...v10.0.0
90
101
  [9.0.1]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...v9.0.1
package/README.md CHANGED
@@ -6,7 +6,7 @@ MetaMask's [TypeScript](https://www.typescriptlang.org) ESLint configuration.
6
6
 
7
7
  ```bash
8
8
  yarn add --dev \
9
- @metamask/eslint-config@^11.0.0 \
9
+ @metamask/eslint-config@^11.0.1 \
10
10
  @metamask/eslint-config-typescript@^11.0.0 \
11
11
  @typescript-eslint/eslint-plugin@^5.42.1 \
12
12
  @typescript-eslint/parser@^5.42.1 \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/eslint-config-typescript",
3
- "version": "11.0.0",
3
+ "version": "11.1.0",
4
4
  "description": "Shareable MetaMask ESLint config for TypeScript.",
5
5
  "homepage": "https://github.com/MetaMask/eslint-config#readme",
6
6
  "bugs": {
@@ -13,7 +13,9 @@
13
13
  "license": "MIT",
14
14
  "main": "src/index.js",
15
15
  "files": [
16
- "src/"
16
+ "src/",
17
+ "!src/**/*.test.js",
18
+ "!src/**/__test__"
17
19
  ],
18
20
  "scripts": {
19
21
  "lint:changelog": "auto-changelog validate",
@@ -47,4 +49,4 @@
47
49
  "access": "public",
48
50
  "registry": "https://registry.npmjs.org/"
49
51
  }
50
- }
52
+ }
package/src/index.js CHANGED
@@ -72,6 +72,9 @@ module.exports = {
72
72
  '@typescript-eslint/no-unsafe-member-access': 'off',
73
73
  '@typescript-eslint/no-unsafe-return': 'off',
74
74
 
75
+ // Recommended rules that we do not want to use
76
+ '@typescript-eslint/require-await': 'off',
77
+
75
78
  // Our rules that require type information
76
79
  '@typescript-eslint/consistent-type-exports': 'error',
77
80
  '@typescript-eslint/naming-convention': [
@@ -111,6 +114,11 @@ module.exports = {
111
114
  format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
112
115
  leadingUnderscore: 'allow',
113
116
  },
117
+ {
118
+ selector: 'parameter',
119
+ format: ['camelCase', 'PascalCase'],
120
+ leadingUnderscore: 'allow',
121
+ },
114
122
  ],
115
123
  '@typescript-eslint/no-meaningless-void-operator': 'error',
116
124
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
@@ -1,2 +0,0 @@
1
- // This file is only used to test the config.
2
- console.log('Hello, world!');
package/src/index.test.js DELETED
@@ -1,31 +0,0 @@
1
- const { ESLint } = require('eslint');
2
- const { resolve } = require('path');
3
-
4
- const config = require('.');
5
-
6
- describe('index', () => {
7
- it('is a valid ESLint config', async () => {
8
- const api = new ESLint({
9
- baseConfig: config,
10
- useEslintrc: false,
11
- overrideConfig: {
12
- env: {
13
- node: true,
14
- },
15
- parserOptions: {
16
- tsconfigRootDir: resolve(__dirname, '..'),
17
- project: 'tsconfig.json',
18
- },
19
- },
20
- });
21
-
22
- // In order to test rules that require type information, we need to actually
23
- // compile the file with TypeScript, so rather than using `api.lintText()`,
24
- // we use `api.lintFiles()` and pass in a file that we know will pass.
25
- const result = await api.lintFiles(resolve(__dirname, '__test__/dummy.ts'));
26
-
27
- expect(result[0].messages).toStrictEqual([]);
28
- expect(result[0].warningCount).toBe(0);
29
- expect(result[0].errorCount).toBe(0);
30
- });
31
- });