@abinnovision/eslint-config-typescript 1.1.0 → 2.0.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 +29 -10
- package/README.md +1 -14
- package/dist/index.d.mts +32 -0
- package/dist/index.d.ts +32 -4
- package/dist/index.js +59 -16
- package/dist/index.mjs +48 -0
- package/package.json +42 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,35 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [2.0.0](https://github.com/abinnovision/js-commons/compare/eslint-config-typescript-v1.2.0...eslint-config-typescript-v2.0.0) (2023-11-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* will drop support for legacy eslint configs
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* enable new ESLint rules ([#104](https://github.com/abinnovision/js-commons/issues/104)) ([ffac1dc](https://github.com/abinnovision/js-commons/commit/ffac1dc4bc2c6794c2f7d1bd1ec72542e20cd06d))
|
|
13
|
+
* migrate to eslint flat config ([#93](https://github.com/abinnovision/js-commons/issues/93)) ([7568ba1](https://github.com/abinnovision/js-commons/commit/7568ba1782f912357e18619ab3e4e56a0c738a1c))
|
|
14
|
+
|
|
15
|
+
## [1.2.0](https://github.com/abinnovision/js-commons/compare/eslint-config-typescript-v1.1.0...eslint-config-typescript-v1.2.0) (2023-10-28)
|
|
4
16
|
|
|
5
17
|
|
|
6
18
|
### Features
|
|
7
19
|
|
|
8
|
-
*
|
|
20
|
+
* update eslint-config-alloy to v5.0.0 ([6acd7da](https://github.com/abinnovision/js-commons/commit/6acd7dacca62218dc3b72611dae6b0154ba16388))
|
|
9
21
|
|
|
10
22
|
|
|
11
23
|
### Bug Fixes
|
|
12
24
|
|
|
13
|
-
*
|
|
14
|
-
* emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
|
|
25
|
+
* align peer dependency versions ([#88](https://github.com/abinnovision/js-commons/issues/88)) ([62e752d](https://github.com/abinnovision/js-commons/commit/62e752d625fd3f454a50c58119f52fa4bbba297d))
|
|
15
26
|
|
|
16
|
-
## [1.0
|
|
27
|
+
## [1.1.0](https://github.com/abinnovision/js-commons/compare/eslint-config-typescript-v1.0.2...eslint-config-typescript-v1.1.0) (2023-04-21)
|
|
17
28
|
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
- first implementation ([470e5d5](https://github.com/abinnovision/js-commons/commit/470e5d591bd711b5d793037c946bf56883d5acf3))
|
|
18
32
|
|
|
19
33
|
### Bug Fixes
|
|
20
34
|
|
|
21
|
-
|
|
35
|
+
- add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
|
|
36
|
+
- emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
|
|
22
37
|
|
|
23
|
-
## [1.0.
|
|
38
|
+
## [1.0.2](https://github.com/abinnovision/js-commons/compare/eslint-config-typescript-v1.0.1...eslint-config-typescript-v1.0.2) (2023-04-21)
|
|
24
39
|
|
|
40
|
+
### Bug Fixes
|
|
41
|
+
|
|
42
|
+
- emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
|
|
43
|
+
|
|
44
|
+
## [1.0.1](https://github.com/abinnovision/js-commons/compare/eslint-config-typescript-v1.0.0...eslint-config-typescript-v1.0.1) (2023-04-21)
|
|
25
45
|
|
|
26
46
|
### Bug Fixes
|
|
27
47
|
|
|
28
|
-
|
|
48
|
+
- add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
|
|
29
49
|
|
|
30
50
|
## 1.0.0 (2023-02-23)
|
|
31
51
|
|
|
32
|
-
|
|
33
52
|
### Features
|
|
34
53
|
|
|
35
|
-
|
|
54
|
+
- first implementation ([470e5d5](https://github.com/abinnovision/eslint-config/commit/470e5d591bd711b5d793037c946bf56883d5acf3))
|
package/README.md
CHANGED
|
@@ -10,18 +10,5 @@ with some additional goodies on top.
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
12
|
```shell
|
|
13
|
-
yarn add --dev
|
|
14
|
-
# This config itself.
|
|
15
|
-
@abinnovision/eslint-config-typescript \
|
|
16
|
-
# Required configs/plugins by this config.
|
|
17
|
-
eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser
|
|
13
|
+
yarn add --dev @abinnovision/eslint-config-typescript
|
|
18
14
|
```
|
|
19
|
-
|
|
20
|
-
## Dependencies
|
|
21
|
-
|
|
22
|
-
This config requires the following dependencies (defined as peer dependencies):
|
|
23
|
-
|
|
24
|
-
* [eslint](https://www.npmjs.com/package/eslint)
|
|
25
|
-
* [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
|
|
26
|
-
* [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser)
|
|
27
|
-
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as _typescript_eslint_eslint_plugin_rules from '@typescript-eslint/eslint-plugin/rules';
|
|
2
|
+
|
|
3
|
+
declare const config: {
|
|
4
|
+
files: string[];
|
|
5
|
+
plugins: {
|
|
6
|
+
"@typescript-eslint": {
|
|
7
|
+
configs: Record<string, TSESLint.Linter.Config>;
|
|
8
|
+
rules: _typescript_eslint_eslint_plugin_rules.TypeScriptESLintRules;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: any;
|
|
13
|
+
parserOptions: {
|
|
14
|
+
project: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
rules: {
|
|
18
|
+
/**
|
|
19
|
+
* Enforce to use `return await` for async functions.
|
|
20
|
+
* This rule is set to "always" because it's a good practice to use
|
|
21
|
+
* `return await` for async functions.
|
|
22
|
+
*
|
|
23
|
+
* NOTE: This is overridden from the base config.
|
|
24
|
+
*
|
|
25
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
26
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
27
|
+
*/
|
|
28
|
+
"@typescript-eslint/return-await": ["warn", string];
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
|
|
32
|
+
export { config as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const config:
|
|
4
|
-
|
|
1
|
+
import * as _typescript_eslint_eslint_plugin_rules from '@typescript-eslint/eslint-plugin/rules';
|
|
2
|
+
|
|
3
|
+
declare const config: {
|
|
4
|
+
files: string[];
|
|
5
|
+
plugins: {
|
|
6
|
+
"@typescript-eslint": {
|
|
7
|
+
configs: Record<string, TSESLint.Linter.Config>;
|
|
8
|
+
rules: _typescript_eslint_eslint_plugin_rules.TypeScriptESLintRules;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: any;
|
|
13
|
+
parserOptions: {
|
|
14
|
+
project: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
rules: {
|
|
18
|
+
/**
|
|
19
|
+
* Enforce to use `return await` for async functions.
|
|
20
|
+
* This rule is set to "always" because it's a good practice to use
|
|
21
|
+
* `return await` for async functions.
|
|
22
|
+
*
|
|
23
|
+
* NOTE: This is overridden from the base config.
|
|
24
|
+
*
|
|
25
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
26
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
27
|
+
*/
|
|
28
|
+
"@typescript-eslint/return-await": ["warn", string];
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
|
|
32
|
+
export { config as default };
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
parser: "@typescript-eslint/parser",
|
|
16
|
-
plugins: ["@typescript-eslint"],
|
|
17
|
-
rules: __assign({}, AlloyTypescript.rules),
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
18
15
|
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
|
|
25
|
+
// src/index.ts
|
|
26
|
+
var TypescriptEslintPlugin = __toESM(require("@typescript-eslint/eslint-plugin"));
|
|
27
|
+
var TypescriptEslintParser = __toESM(require("@typescript-eslint/parser"));
|
|
28
|
+
var AlloyTypescript = __toESM(require("eslint-config-alloy/typescript"));
|
|
29
|
+
var config = [
|
|
30
|
+
{
|
|
31
|
+
files: ["**/*.{ts,tsx}"],
|
|
32
|
+
plugins: {
|
|
33
|
+
"@typescript-eslint": TypescriptEslintPlugin
|
|
34
|
+
},
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parser: TypescriptEslintParser,
|
|
37
|
+
parserOptions: {
|
|
38
|
+
project: "./tsconfig.json"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
rules: {
|
|
42
|
+
/**
|
|
43
|
+
* Use the rules from the base config as defaults.
|
|
44
|
+
*
|
|
45
|
+
* @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1&rule=typescript
|
|
46
|
+
*/
|
|
47
|
+
...AlloyTypescript.rules ?? {},
|
|
48
|
+
/**
|
|
49
|
+
* Enforce to use `return await` for async functions.
|
|
50
|
+
* This rule is set to "always" because it's a good practice to use
|
|
51
|
+
* `return await` for async functions.
|
|
52
|
+
*
|
|
53
|
+
* NOTE: This is overridden from the base config.
|
|
54
|
+
*
|
|
55
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
56
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
57
|
+
*/
|
|
58
|
+
"@typescript-eslint/return-await": ["warn", "always"]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
];
|
|
19
62
|
module.exports = config;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
// src/index.ts
|
|
7
|
+
import * as TypescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
|
|
8
|
+
import * as TypescriptEslintParser from "@typescript-eslint/parser";
|
|
9
|
+
import * as AlloyTypescript from "eslint-config-alloy/typescript";
|
|
10
|
+
var require_src = __commonJS({
|
|
11
|
+
"src/index.ts"(exports, module) {
|
|
12
|
+
var config = [
|
|
13
|
+
{
|
|
14
|
+
files: ["**/*.{ts,tsx}"],
|
|
15
|
+
plugins: {
|
|
16
|
+
"@typescript-eslint": TypescriptEslintPlugin
|
|
17
|
+
},
|
|
18
|
+
languageOptions: {
|
|
19
|
+
parser: TypescriptEslintParser,
|
|
20
|
+
parserOptions: {
|
|
21
|
+
project: "./tsconfig.json"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
/**
|
|
26
|
+
* Use the rules from the base config as defaults.
|
|
27
|
+
*
|
|
28
|
+
* @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1&rule=typescript
|
|
29
|
+
*/
|
|
30
|
+
...AlloyTypescript.rules ?? {},
|
|
31
|
+
/**
|
|
32
|
+
* Enforce to use `return await` for async functions.
|
|
33
|
+
* This rule is set to "always" because it's a good practice to use
|
|
34
|
+
* `return await` for async functions.
|
|
35
|
+
*
|
|
36
|
+
* NOTE: This is overridden from the base config.
|
|
37
|
+
*
|
|
38
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
39
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
40
|
+
*/
|
|
41
|
+
"@typescript-eslint/return-await": ["warn", "always"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
module.exports = config;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export default require_src();
|
package/package.json
CHANGED
|
@@ -1,37 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abinnovision/eslint-config-typescript",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"url": "https://github.com/abinnovision/js-commons"
|
|
6
|
+
},
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"author": {
|
|
9
|
-
"name": "AB INNOVISION
|
|
9
|
+
"name": "AB INNOVISION GmbH",
|
|
10
10
|
"email": "info@abinnovision.com",
|
|
11
11
|
"url": "https://abinnovision.com/"
|
|
12
12
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts"
|
|
18
|
+
}
|
|
15
19
|
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"module": "./dist/index.mjs",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
16
23
|
"files": [
|
|
17
24
|
"dist/"
|
|
18
25
|
],
|
|
19
26
|
"scripts": {
|
|
20
|
-
"build": "
|
|
27
|
+
"build": "tsup src/index.ts --dts --format esm,cjs --clean",
|
|
28
|
+
"format:check": "prettier --check 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
|
|
29
|
+
"format:fix": "prettier --write 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
|
|
30
|
+
"lint:check": "eslint 'src/**/*.{ts,js}'",
|
|
31
|
+
"lint:fix": "eslint --fix 'src/**/*.{ts,js}'"
|
|
32
|
+
},
|
|
33
|
+
"lint-staged": {
|
|
34
|
+
"src/**/*.{ts,js}": [
|
|
35
|
+
"prettier --write",
|
|
36
|
+
"eslint --fix"
|
|
37
|
+
],
|
|
38
|
+
"{**/*,*}.{md,json,json5,yaml,yml}": [
|
|
39
|
+
"prettier --write"
|
|
40
|
+
]
|
|
21
41
|
},
|
|
42
|
+
"prettier": "@abinnovision/prettier-config",
|
|
22
43
|
"dependencies": {
|
|
23
|
-
"eslint-
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
|
45
|
+
"@typescript-eslint/parser": "^6.9.0",
|
|
46
|
+
"eslint-config-alloy": "^5.1.2"
|
|
24
47
|
},
|
|
25
48
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@types/
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
49
|
+
"@abinnovision/prettier-config": "^2.0.0",
|
|
50
|
+
"@types/eslint": "^8.44.6",
|
|
51
|
+
"eslint": "^8.52.0",
|
|
52
|
+
"globals": "^13.23.0",
|
|
53
|
+
"prettier": "^3.0.3",
|
|
54
|
+
"tsup": "^7.2.0",
|
|
55
|
+
"typescript": "^5.2.2"
|
|
31
56
|
},
|
|
32
57
|
"peerDependencies": {
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
58
|
+
"eslint": "^8.24.0"
|
|
59
|
+
},
|
|
60
|
+
"packageManager": "yarn@3.4.1"
|
|
37
61
|
}
|