@abinnovision/eslint-config-typescript 1.2.0 → 2.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 +19 -0
- package/README.md +1 -13
- package/dist/index.cjs +72 -0
- package/dist/index.d.cts +29 -0
- package/dist/index.d.ts +29 -4
- package/dist/index.js +40 -18
- package/package.json +40 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.1.0](https://github.com/abinnovision/js-commons/compare/eslint-config-typescript-v2.0.0...eslint-config-typescript-v2.1.0) (2024-08-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* migrate to esm ([#278](https://github.com/abinnovision/js-commons/issues/278)) ([fed850d](https://github.com/abinnovision/js-commons/commit/fed850d979f7ba83fae75adadcfd0024f2acd242))
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* will drop support for legacy eslint configs
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* enable new ESLint rules ([#104](https://github.com/abinnovision/js-commons/issues/104)) ([ffac1dc](https://github.com/abinnovision/js-commons/commit/ffac1dc4bc2c6794c2f7d1bd1ec72542e20cd06d))
|
|
20
|
+
* migrate to eslint flat config ([#93](https://github.com/abinnovision/js-commons/issues/93)) ([7568ba1](https://github.com/abinnovision/js-commons/commit/7568ba1782f912357e18619ab3e4e56a0c738a1c))
|
|
21
|
+
|
|
3
22
|
## [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
23
|
|
|
5
24
|
|
package/README.md
CHANGED
|
@@ -10,17 +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)
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
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 __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
default: () => src_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
37
|
+
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
|
38
|
+
var import_typescript = __toESM(require("eslint-config-alloy/typescript.js"), 1);
|
|
39
|
+
var config = [
|
|
40
|
+
{
|
|
41
|
+
files: ["**/*.{ts,tsx}"],
|
|
42
|
+
plugins: {
|
|
43
|
+
"@typescript-eslint": import_eslint_plugin.default
|
|
44
|
+
},
|
|
45
|
+
languageOptions: {
|
|
46
|
+
parser: import_parser.default,
|
|
47
|
+
parserOptions: {
|
|
48
|
+
project: "./tsconfig.json"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
/**
|
|
53
|
+
* Use the rules from the base config as defaults.
|
|
54
|
+
*
|
|
55
|
+
* @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1&rule=typescript
|
|
56
|
+
*/
|
|
57
|
+
...import_typescript.default.rules ?? {},
|
|
58
|
+
/**
|
|
59
|
+
* Enforce to use `return await` for async functions.
|
|
60
|
+
* This rule is set to "always" because it's a good practice to use
|
|
61
|
+
* `return await` for async functions.
|
|
62
|
+
*
|
|
63
|
+
* NOTE: This is overridden from the base config.
|
|
64
|
+
*
|
|
65
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
66
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
67
|
+
*/
|
|
68
|
+
"@typescript-eslint/return-await": ["warn", "always"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
var src_default = config;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import TypescriptEslintParser from '@typescript-eslint/parser';
|
|
2
|
+
|
|
3
|
+
declare const config: {
|
|
4
|
+
files: string[];
|
|
5
|
+
plugins: {
|
|
6
|
+
"@typescript-eslint": any;
|
|
7
|
+
};
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parser: typeof TypescriptEslintParser;
|
|
10
|
+
parserOptions: {
|
|
11
|
+
project: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
rules: {
|
|
15
|
+
/**
|
|
16
|
+
* Enforce to use `return await` for async functions.
|
|
17
|
+
* This rule is set to "always" because it's a good practice to use
|
|
18
|
+
* `return await` for async functions.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This is overridden from the base config.
|
|
21
|
+
*
|
|
22
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
23
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
24
|
+
*/
|
|
25
|
+
"@typescript-eslint/return-await": ["warn", string];
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
|
|
29
|
+
export { config as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const config:
|
|
4
|
-
|
|
1
|
+
import TypescriptEslintParser from '@typescript-eslint/parser';
|
|
2
|
+
|
|
3
|
+
declare const config: {
|
|
4
|
+
files: string[];
|
|
5
|
+
plugins: {
|
|
6
|
+
"@typescript-eslint": any;
|
|
7
|
+
};
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parser: typeof TypescriptEslintParser;
|
|
10
|
+
parserOptions: {
|
|
11
|
+
project: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
rules: {
|
|
15
|
+
/**
|
|
16
|
+
* Enforce to use `return await` for async functions.
|
|
17
|
+
* This rule is set to "always" because it's a good practice to use
|
|
18
|
+
* `return await` for async functions.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This is overridden from the base config.
|
|
21
|
+
*
|
|
22
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
23
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
24
|
+
*/
|
|
25
|
+
"@typescript-eslint/return-await": ["warn", string];
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
|
|
29
|
+
export { config as default };
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import TypescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
|
|
3
|
+
import TypescriptEslintParser from "@typescript-eslint/parser";
|
|
4
|
+
import AlloyTypescript from "eslint-config-alloy/typescript.js";
|
|
5
|
+
var config = [
|
|
6
|
+
{
|
|
7
|
+
files: ["**/*.{ts,tsx}"],
|
|
8
|
+
plugins: {
|
|
9
|
+
"@typescript-eslint": TypescriptEslintPlugin
|
|
10
|
+
},
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: TypescriptEslintParser,
|
|
13
|
+
parserOptions: {
|
|
14
|
+
project: "./tsconfig.json"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
/**
|
|
19
|
+
* Use the rules from the base config as defaults.
|
|
20
|
+
*
|
|
21
|
+
* @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1&rule=typescript
|
|
22
|
+
*/
|
|
23
|
+
...AlloyTypescript.rules ?? {},
|
|
24
|
+
/**
|
|
25
|
+
* Enforce to use `return await` for async functions.
|
|
26
|
+
* This rule is set to "always" because it's a good practice to use
|
|
27
|
+
* `return await` for async functions.
|
|
28
|
+
*
|
|
29
|
+
* NOTE: This is overridden from the base config.
|
|
30
|
+
*
|
|
31
|
+
* @see https://typescript-eslint.io/rules/return-await/
|
|
32
|
+
* @see https://stackoverflow.com/questions/43353087/are-there-performance-concerns-with-return-await/70979225#70979225
|
|
33
|
+
*/
|
|
34
|
+
"@typescript-eslint/return-await": ["warn", "always"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
var src_default = config;
|
|
39
|
+
export {
|
|
40
|
+
src_default as default
|
|
12
41
|
};
|
|
13
|
-
var AlloyTypescript = require("eslint-config-alloy/typescript");
|
|
14
|
-
var config = {
|
|
15
|
-
parser: "@typescript-eslint/parser",
|
|
16
|
-
plugins: ["@typescript-eslint"],
|
|
17
|
-
rules: __assign({}, AlloyTypescript.rules),
|
|
18
|
-
};
|
|
19
|
-
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abinnovision/eslint-config-typescript",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/abinnovision/js-commons"
|
|
7
|
+
},
|
|
7
8
|
"license": "Apache-2.0",
|
|
8
9
|
"author": {
|
|
9
|
-
"name": "AB INNOVISION
|
|
10
|
+
"name": "AB INNOVISION GmbH",
|
|
10
11
|
"email": "info@abinnovision.com",
|
|
11
12
|
"url": "https://abinnovision.com/"
|
|
12
13
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
}
|
|
15
20
|
},
|
|
21
|
+
"main": "./dist/index.cjs",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
16
24
|
"files": [
|
|
17
25
|
"dist/"
|
|
18
26
|
],
|
|
19
27
|
"scripts": {
|
|
20
|
-
"build": "
|
|
21
|
-
"lint:check": "eslint 'src/**/*.{ts,js}'",
|
|
22
|
-
"lint:fix": "eslint --fix 'src/**/*.{ts,js}'",
|
|
28
|
+
"build": "tsup src/index.ts --dts --format esm,cjs --clean",
|
|
23
29
|
"format:check": "prettier --check 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
|
|
24
|
-
"format:fix": "prettier --write 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"eslint-config-alloy": "^5.1.2"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@abinnovision/prettier-config": "^1.1.0",
|
|
31
|
-
"@types/eslint": "^8.21.1",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
|
33
|
-
"@typescript-eslint/parser": "^6.9.0",
|
|
34
|
-
"eslint": "^8.52.0",
|
|
35
|
-
"prettier": "^3.0.3",
|
|
36
|
-
"typescript": "^5.2.2"
|
|
37
|
-
},
|
|
38
|
-
"peerDependencies": {
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
40
|
-
"@typescript-eslint/parser": "^6.0.0",
|
|
41
|
-
"eslint": "^8.24.0"
|
|
42
|
-
},
|
|
43
|
-
"eslintConfig": {
|
|
44
|
-
"extends": [
|
|
45
|
-
"@abinnovision/eslint-config-base",
|
|
46
|
-
"./dist/index.js"
|
|
47
|
-
],
|
|
48
|
-
"parserOptions": {
|
|
49
|
-
"project": "./tsconfig.json"
|
|
50
|
-
}
|
|
30
|
+
"format:fix": "prettier --write 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
|
|
31
|
+
"lint:check": "eslint 'src/**/*.{ts,js}'",
|
|
32
|
+
"lint:fix": "eslint --fix 'src/**/*.{ts,js}'"
|
|
51
33
|
},
|
|
52
|
-
"prettier": "@abinnovision/prettier-config",
|
|
53
34
|
"lint-staged": {
|
|
54
35
|
"src/**/*.{ts,js}": [
|
|
55
36
|
"prettier --write",
|
|
56
37
|
"eslint --fix"
|
|
57
38
|
],
|
|
58
|
-
"
|
|
39
|
+
"{**/*,*}.{md,json,json5,yaml,yml}": [
|
|
59
40
|
"prettier --write"
|
|
60
41
|
]
|
|
61
|
-
}
|
|
42
|
+
},
|
|
43
|
+
"prettier": "@abinnovision/prettier-config",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
46
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
47
|
+
"eslint-config-alloy": "^5.1.2"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@abinnovision/prettier-config": "^2.1.0",
|
|
51
|
+
"@types/eslint": "^9.6.0",
|
|
52
|
+
"eslint": "^9.8.0",
|
|
53
|
+
"globals": "^15.9.0",
|
|
54
|
+
"prettier": "^3.3.3",
|
|
55
|
+
"tsup": "^8.2.4",
|
|
56
|
+
"typescript": "^5.5.4"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"eslint": "^8.24.0 || ^9.0.0"
|
|
60
|
+
},
|
|
61
|
+
"packageManager": "yarn@3.4.1"
|
|
62
62
|
}
|