@abinnovision/eslint-config-base 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 CHANGED
@@ -1,35 +1,54 @@
1
1
  # Changelog
2
2
 
3
- ## [1.1.0](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v1.0.2...eslint-config-base-v1.1.0) (2023-04-21)
3
+ ## [2.0.0](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v1.2.0...eslint-config-base-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-base-v1.1.0...eslint-config-base-v1.2.0) (2023-10-28)
4
16
 
5
17
 
6
18
  ### Features
7
19
 
8
- * first implementation ([470e5d5](https://github.com/abinnovision/js-commons/commit/470e5d591bd711b5d793037c946bf56883d5acf3))
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
- * add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
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.2](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v1.0.1...eslint-config-base-v1.0.2) (2023-04-21)
27
+ ## [1.1.0](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v1.0.2...eslint-config-base-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
- * emit declarations ([616f817](https://github.com/abinnovision/js-commons/commit/616f817ca7701e160325e1e81d633df345244cc3))
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.1](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v1.0.0...eslint-config-base-v1.0.1) (2023-04-21)
38
+ ## [1.0.2](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v1.0.1...eslint-config-base-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-base-v1.0.0...eslint-config-base-v1.0.1) (2023-04-21)
25
45
 
26
46
  ### Bug Fixes
27
47
 
28
- * add correct license to all packages ([af7343d](https://github.com/abinnovision/js-commons/commit/af7343dbdb93329a0321a369f81e9b37da9068fa))
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
- * first implementation ([470e5d5](https://github.com/abinnovision/eslint-config/commit/470e5d591bd711b5d793037c946bf56883d5acf3))
54
+ - first implementation ([470e5d5](https://github.com/abinnovision/eslint-config/commit/470e5d591bd711b5d793037c946bf56883d5acf3))
package/README.md CHANGED
@@ -1,24 +1,13 @@
1
1
  # @abinnovision/eslint-config-base
2
2
 
3
3
  Base ESLint config, which can be used with Javascript only if applied
4
- standalone. This config is based on
4
+ standalone.
5
+ This config is based on
5
6
  the [AlloyTeam ESLint Config](https://github.com/AlloyTeam/eslint-config-alloy)
6
7
  with some additional goodies on top.
7
8
 
8
9
  ## Installation
9
10
 
10
11
  ```shell
11
- yarn add --dev \
12
- # This config itself.
13
- @abinnovision/eslint-config-base \
14
- # Required configs/plugins by this config.
15
- eslint eslint-plugin-import
12
+ yarn add --dev @abinnovision/eslint-config-base
16
13
  ```
17
-
18
- ## Dependencies
19
-
20
- This config requires the following dependencies (defined as peer dependencies):
21
-
22
- * [eslint](https://www.npmjs.com/package/eslint)
23
- * [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import)
24
-
@@ -0,0 +1,53 @@
1
+ declare const config: {
2
+ files: string[];
3
+ languageOptions: {
4
+ ecmaVersion: "latest";
5
+ };
6
+ plugins: {
7
+ import: Plugin;
8
+ };
9
+ rules: {
10
+ /**
11
+ * Enforce a consistent order and grouping of import statements.
12
+ *
13
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
14
+ */
15
+ "import/order": ["error", {
16
+ groups: string[][];
17
+ "newlines-between": string;
18
+ alphabetize: {
19
+ order: string;
20
+ caseInsensitive: boolean;
21
+ };
22
+ warnOnUnassignedImports: boolean;
23
+ }];
24
+ /**
25
+ * Enforce the "export" statement is placed at the end of the file.
26
+ * This avoids sprinkling export statements throughout the file.
27
+ *
28
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
29
+ */
30
+ "import/exports-last": "warn";
31
+ /**
32
+ * Import statements should always be the first statements in a file.
33
+ * This makes it easier to identify the dependencies of a file.
34
+ *
35
+ * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
36
+ *
37
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
38
+ */
39
+ "import/first": "error";
40
+ /**
41
+ * Enforce a newline after the import statements.
42
+ *
43
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
44
+ */
45
+ "import/newline-after-import": "error";
46
+ /**
47
+ * Disable the "no-return-await" rule.
48
+ */
49
+ "no-return-await": "off";
50
+ };
51
+ }[];
52
+
53
+ export { config as default };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,53 @@
1
- import type { Linter } from "eslint";
2
- import type { ESLintRules } from "eslint/rules";
3
- declare const config: Linter.BaseConfig<ESLintRules>;
4
- export = config;
1
+ declare const config: {
2
+ files: string[];
3
+ languageOptions: {
4
+ ecmaVersion: "latest";
5
+ };
6
+ plugins: {
7
+ import: Plugin;
8
+ };
9
+ rules: {
10
+ /**
11
+ * Enforce a consistent order and grouping of import statements.
12
+ *
13
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
14
+ */
15
+ "import/order": ["error", {
16
+ groups: string[][];
17
+ "newlines-between": string;
18
+ alphabetize: {
19
+ order: string;
20
+ caseInsensitive: boolean;
21
+ };
22
+ warnOnUnassignedImports: boolean;
23
+ }];
24
+ /**
25
+ * Enforce the "export" statement is placed at the end of the file.
26
+ * This avoids sprinkling export statements throughout the file.
27
+ *
28
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
29
+ */
30
+ "import/exports-last": "warn";
31
+ /**
32
+ * Import statements should always be the first statements in a file.
33
+ * This makes it easier to identify the dependencies of a file.
34
+ *
35
+ * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
36
+ *
37
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
38
+ */
39
+ "import/first": "error";
40
+ /**
41
+ * Enforce a newline after the import statements.
42
+ *
43
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
44
+ */
45
+ "import/newline-after-import": "error";
46
+ /**
47
+ * Disable the "no-return-await" rule.
48
+ */
49
+ "no-return-await": "off";
50
+ };
51
+ }[];
52
+
53
+ export { config as default };
package/dist/index.js CHANGED
@@ -1,40 +1,94 @@
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);
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;
12
15
  };
13
- var _a;
14
- var AlloyBase = require("eslint-config-alloy/base");
15
- var config = {
16
- parserOptions: {
17
- ecmaVersion: "latest",
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 AlloyBase = __toESM(require("eslint-config-alloy/base"));
27
+ var eslintPluginImport = __toESM(require("eslint-plugin-import"));
28
+ var config = [
29
+ {
30
+ files: ["**/*.{ts,tsx,js,jsx}"],
31
+ languageOptions: {
32
+ ecmaVersion: "latest"
18
33
  },
19
- env: {
20
- browser: true,
21
- node: true,
22
- commonjs: true,
23
- es6: true,
34
+ plugins: {
35
+ import: eslintPluginImport
24
36
  },
25
- plugins: ["import"],
26
- rules: __assign(__assign({}, ((_a = AlloyBase.rules) !== null && _a !== void 0 ? _a : {})), { "import/order": [
27
- "error",
28
- {
29
- groups: [
30
- ["builtin", "external"],
31
- ["internal", "unknown", "parent", "sibling", "index"],
32
- ["object", "type"],
33
- ],
34
- "newlines-between": "always",
35
- alphabetize: { order: "asc", caseInsensitive: true },
36
- warnOnUnassignedImports: true,
37
- },
38
- ] }),
39
- };
37
+ rules: {
38
+ /**
39
+ * Use the rules from the base config as defaults.
40
+ *
41
+ * @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1
42
+ */
43
+ ...AlloyBase.rules ?? {},
44
+ /**
45
+ * Enforce a consistent order and grouping of import statements.
46
+ *
47
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
48
+ */
49
+ "import/order": [
50
+ "error",
51
+ {
52
+ groups: [
53
+ // Externals
54
+ ["builtin", "external"],
55
+ // Internals
56
+ ["internal", "unknown", "parent", "sibling", "index"],
57
+ // Types
58
+ ["object", "type"]
59
+ ],
60
+ "newlines-between": "always",
61
+ alphabetize: { order: "asc", caseInsensitive: true },
62
+ warnOnUnassignedImports: true
63
+ }
64
+ ],
65
+ /**
66
+ * Enforce the "export" statement is placed at the end of the file.
67
+ * This avoids sprinkling export statements throughout the file.
68
+ *
69
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
70
+ */
71
+ "import/exports-last": "warn",
72
+ /**
73
+ * Import statements should always be the first statements in a file.
74
+ * This makes it easier to identify the dependencies of a file.
75
+ *
76
+ * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
77
+ *
78
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
79
+ */
80
+ "import/first": "error",
81
+ /**
82
+ * Enforce a newline after the import statements.
83
+ *
84
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
85
+ */
86
+ "import/newline-after-import": "error",
87
+ /**
88
+ * Disable the "no-return-await" rule.
89
+ */
90
+ "no-return-await": "off"
91
+ }
92
+ }
93
+ ];
40
94
  module.exports = config;
package/dist/index.mjs ADDED
@@ -0,0 +1,80 @@
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 AlloyBase from "eslint-config-alloy/base";
8
+ import * as eslintPluginImport from "eslint-plugin-import";
9
+ var require_src = __commonJS({
10
+ "src/index.ts"(exports, module) {
11
+ var config = [
12
+ {
13
+ files: ["**/*.{ts,tsx,js,jsx}"],
14
+ languageOptions: {
15
+ ecmaVersion: "latest"
16
+ },
17
+ plugins: {
18
+ import: eslintPluginImport
19
+ },
20
+ rules: {
21
+ /**
22
+ * Use the rules from the base config as defaults.
23
+ *
24
+ * @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1
25
+ */
26
+ ...AlloyBase.rules ?? {},
27
+ /**
28
+ * Enforce a consistent order and grouping of import statements.
29
+ *
30
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
31
+ */
32
+ "import/order": [
33
+ "error",
34
+ {
35
+ groups: [
36
+ // Externals
37
+ ["builtin", "external"],
38
+ // Internals
39
+ ["internal", "unknown", "parent", "sibling", "index"],
40
+ // Types
41
+ ["object", "type"]
42
+ ],
43
+ "newlines-between": "always",
44
+ alphabetize: { order: "asc", caseInsensitive: true },
45
+ warnOnUnassignedImports: true
46
+ }
47
+ ],
48
+ /**
49
+ * Enforce the "export" statement is placed at the end of the file.
50
+ * This avoids sprinkling export statements throughout the file.
51
+ *
52
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
53
+ */
54
+ "import/exports-last": "warn",
55
+ /**
56
+ * Import statements should always be the first statements in a file.
57
+ * This makes it easier to identify the dependencies of a file.
58
+ *
59
+ * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
60
+ *
61
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
62
+ */
63
+ "import/first": "error",
64
+ /**
65
+ * Enforce a newline after the import statements.
66
+ *
67
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
68
+ */
69
+ "import/newline-after-import": "error",
70
+ /**
71
+ * Disable the "no-return-await" rule.
72
+ */
73
+ "no-return-await": "off"
74
+ }
75
+ }
76
+ ];
77
+ module.exports = config;
78
+ }
79
+ });
80
+ export default require_src();
package/package.json CHANGED
@@ -1,34 +1,59 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-base",
3
- "packageManager": "yarn@3.4.1",
4
- "version": "1.1.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"
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-config-alloy": "^4.9.0"
44
+ "eslint-config-alloy": "^5.1.2",
45
+ "eslint-plugin-import": "^2.29.0"
24
46
  },
25
47
  "devDependencies": {
26
- "@types/eslint": "^8.21.1",
27
- "@types/node": "^18.14.1",
28
- "typescript": "^5.0.2"
48
+ "@abinnovision/prettier-config": "^2.0.0",
49
+ "@types/eslint": "^8.44.6",
50
+ "eslint": "^8.52.0",
51
+ "globals": "^13.23.0",
52
+ "prettier": "^3.0.3",
53
+ "tsup": "^7.2.0"
29
54
  },
30
55
  "peerDependencies": {
31
- "eslint": "^8.0.0",
32
- "eslint-plugin-import": "^2.0.0"
33
- }
56
+ "eslint": "^8.24.0"
57
+ },
58
+ "packageManager": "yarn@3.4.1"
34
59
  }