@abinnovision/eslint-config-typescript 1.2.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
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
+
3
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
 
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)
@@ -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 type { Linter } from "eslint";
2
- import type { ESLintRules } from "eslint/rules";
3
- declare const config: Linter.BaseConfig<ESLintRules>;
4
- export = config;
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 __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
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),
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,62 +1,61 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-typescript",
3
- "packageManager": "yarn@3.4.1",
4
- "version": "1.2.0",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
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 UG (limited liability)",
9
+ "name": "AB INNOVISION GmbH",
10
10
  "email": "info@abinnovision.com",
11
11
  "url": "https://abinnovision.com/"
12
12
  },
13
- "repository": {
14
- "url": "https://github.com/abinnovision/js-commons"
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": "tsc",
21
- "lint:check": "eslint 'src/**/*.{ts,js}'",
22
- "lint:fix": "eslint --fix 'src/**/*.{ts,js}'",
27
+ "build": "tsup src/index.ts --dts --format esm,cjs --clean",
23
28
  "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}'"
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
+ ]
25
41
  },
42
+ "prettier": "@abinnovision/prettier-config",
26
43
  "dependencies": {
44
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
45
+ "@typescript-eslint/parser": "^6.9.0",
27
46
  "eslint-config-alloy": "^5.1.2"
28
47
  },
29
48
  "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",
49
+ "@abinnovision/prettier-config": "^2.0.0",
50
+ "@types/eslint": "^8.44.6",
34
51
  "eslint": "^8.52.0",
52
+ "globals": "^13.23.0",
35
53
  "prettier": "^3.0.3",
54
+ "tsup": "^7.2.0",
36
55
  "typescript": "^5.2.2"
37
56
  },
38
57
  "peerDependencies": {
39
- "@typescript-eslint/eslint-plugin": "^6.0.0",
40
- "@typescript-eslint/parser": "^6.0.0",
41
58
  "eslint": "^8.24.0"
42
59
  },
43
- "eslintConfig": {
44
- "extends": [
45
- "@abinnovision/eslint-config-base",
46
- "./dist/index.js"
47
- ],
48
- "parserOptions": {
49
- "project": "./tsconfig.json"
50
- }
51
- },
52
- "prettier": "@abinnovision/prettier-config",
53
- "lint-staged": {
54
- "src/**/*.{ts,js}": [
55
- "prettier --write",
56
- "eslint --fix"
57
- ],
58
- "**/*.{md,json,json5,yaml,yml}": [
59
- "prettier --write"
60
- ]
61
- }
60
+ "packageManager": "yarn@3.4.1"
62
61
  }