@danielwaltz/eslint-config 0.0.2 → 0.0.4

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 ADDED
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+
4
+ ## v0.0.4
5
+
6
+ [compare changes](https://github.com/danielwaltz/eslint-config/compare/v0.0.3...v0.0.4)
7
+
8
+ ### 🩹 Fixes
9
+
10
+ - Make main config fn synchronous ([aa1682c](https://github.com/danielwaltz/eslint-config/commit/aa1682c))
11
+
12
+ ### ❤️ Contributors
13
+
14
+ - Daniel Waltz ([@danielwaltz](http://github.com/danielwaltz))
15
+
16
+ ## v0.0.3
17
+
18
+ [compare changes](https://github.com/danielwaltz/eslint-config/compare/v0.0.2...v0.0.3)
19
+
20
+ ### 🚀 Enhancements
21
+
22
+ - Add import configs ([3990a67](https://github.com/danielwaltz/eslint-config/commit/3990a67))
23
+
24
+ ### 🩹 Fixes
25
+
26
+ - Use warn level for prettier rule ([ce9e60c](https://github.com/danielwaltz/eslint-config/commit/ce9e60c))
27
+
28
+ ### 📖 Documentation
29
+
30
+ - Add readme ([3dce66a](https://github.com/danielwaltz/eslint-config/commit/3dce66a))
31
+
32
+ ### 🏡 Chore
33
+
34
+ - Include readme and changelog in dist ([1c29ead](https://github.com/danielwaltz/eslint-config/commit/1c29ead))
35
+ - Split test and release scripts ([84b0646](https://github.com/danielwaltz/eslint-config/commit/84b0646))
36
+
37
+ ### ❤️ Contributors
38
+
39
+ - Daniel Waltz ([@danielwaltz](http://github.com/danielwaltz))
40
+
41
+ ## v0.0.2
42
+
43
+
44
+ ### 🚀 Enhancements
45
+
46
+ - Initial config ([2307e38](https://github.com/danielwaltz/eslint-config/commit/2307e38))
47
+ - Enable typescript and javascript plugins using recommended rules ([f5a3113](https://github.com/danielwaltz/eslint-config/commit/f5a3113))
48
+
49
+ ### 🏡 Chore
50
+
51
+ - Init ([590fe61](https://github.com/danielwaltz/eslint-config/commit/590fe61))
52
+ - Update config names ([9a857da](https://github.com/danielwaltz/eslint-config/commit/9a857da))
53
+ - Update release script ([30cf611](https://github.com/danielwaltz/eslint-config/commit/30cf611))
54
+
55
+ ### ❤️ Contributors
56
+
57
+ - Daniel Waltz ([@danielwaltz](http://github.com/danielwaltz))
58
+
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # @danielwaltz/eslint-config
2
+
3
+ My personal ESLint configuration.
4
+
5
+ ## Installation
6
+
7
+ ```shell
8
+ npx -y nypm@latest i -D @danielwaltz/eslint-config
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```mjs
14
+ import { danielwaltz } from "@danielwaltz/eslint-config";
15
+
16
+ export default danielwaltz();
17
+ ```
18
+
19
+ ## Customization
20
+
21
+ ```mjs
22
+ import { danielwaltz } from "@danielwaltz/eslint-config";
23
+
24
+ export default danielwaltz([...customRules])
25
+ .prepend([...prependRules])
26
+ .append([...appendRules]);
27
+ ```
package/dist/index.d.mts CHANGED
@@ -1,8 +1,9 @@
1
- import * as eslint from 'eslint';
1
+ import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
2
2
  import { ResolvableFlatConfig, FlatConfigComposer } from 'eslint-flat-config-utils';
3
+ import * as eslint from 'eslint';
3
4
 
4
5
  declare function defineFlatConfigs(...configs: ResolvableFlatConfig[]): FlatConfigComposer;
5
6
 
6
- declare function danielwaltz(...userConfigs: ResolvableFlatConfig[]): Promise<eslint.Linter.Config<eslint.Linter.RulesRecord>[]>;
7
+ declare function danielwaltz(...userConfigs: ResolvableFlatConfig[]): eslint_flat_config_utils.FlatConfigComposer<eslint.Linter.Config<eslint.Linter.RulesRecord>, never>;
7
8
 
8
9
  export { danielwaltz, defineFlatConfigs };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import * as eslint from 'eslint';
1
+ import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
2
2
  import { ResolvableFlatConfig, FlatConfigComposer } from 'eslint-flat-config-utils';
3
+ import * as eslint from 'eslint';
3
4
 
4
5
  declare function defineFlatConfigs(...configs: ResolvableFlatConfig[]): FlatConfigComposer;
5
6
 
6
- declare function danielwaltz(...userConfigs: ResolvableFlatConfig[]): Promise<eslint.Linter.Config<eslint.Linter.RulesRecord>[]>;
7
+ declare function danielwaltz(...userConfigs: ResolvableFlatConfig[]): eslint_flat_config_utils.FlatConfigComposer<eslint.Linter.Config<eslint.Linter.RulesRecord>, never>;
7
8
 
8
9
  export { danielwaltz, defineFlatConfigs };
package/dist/index.mjs CHANGED
@@ -1,9 +1,20 @@
1
1
  import prettier from 'eslint-plugin-prettier/recommended';
2
- import { composer } from 'eslint-flat-config-utils';
2
+ import importPlugin from 'eslint-plugin-import-x';
3
3
  import eslint from '@eslint/js';
4
4
  import tseslint from 'typescript-eslint';
5
+ import { composer } from 'eslint-flat-config-utils';
5
6
 
6
- function global() {
7
+ function formattingConfigs() {
8
+ return [
9
+ prettier,
10
+ {
11
+ rules: { "prettier/prettier": "warn" },
12
+ name: "danielwaltz/formatting/customized"
13
+ }
14
+ ];
15
+ }
16
+
17
+ function globalConfigs() {
7
18
  return [
8
19
  {
9
20
  ignores: [
@@ -21,20 +32,35 @@ function global() {
21
32
  ];
22
33
  }
23
34
 
24
- function formatting() {
35
+ function importConfigs() {
25
36
  return [
37
+ importPlugin.flatConfigs.recommended,
38
+ importPlugin.flatConfigs.typescript,
26
39
  {
27
- ...prettier,
28
- name: "danielwaltz/formatting/prettier"
40
+ files: ["**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,d.ts,vue}"],
41
+ rules: {
42
+ "import-x/no-unresolved": ["error", { ignore: ["\\?*$"] }],
43
+ "import-x/order": [
44
+ "warn",
45
+ {
46
+ groups: [
47
+ "builtin",
48
+ "external",
49
+ "internal",
50
+ "parent",
51
+ "sibling",
52
+ "index"
53
+ ],
54
+ alphabetize: { order: "asc", caseInsensitive: false }
55
+ }
56
+ ]
57
+ },
58
+ name: "danielwaltz/import/customized"
29
59
  }
30
60
  ];
31
61
  }
32
62
 
33
- function defineFlatConfigs(...configs) {
34
- return composer(...configs);
35
- }
36
-
37
- function typescript() {
63
+ function typescriptConfigs() {
38
64
  return tseslint.config(
39
65
  eslint.configs.recommended,
40
66
  tseslint.configs.recommendedTypeChecked,
@@ -67,11 +93,16 @@ function typescript() {
67
93
  );
68
94
  }
69
95
 
70
- async function danielwaltz(...userConfigs) {
96
+ function defineFlatConfigs(...configs) {
97
+ return composer(...configs);
98
+ }
99
+
100
+ function danielwaltz(...userConfigs) {
71
101
  const composer = defineFlatConfigs(...userConfigs);
72
- await composer.prepend(global());
73
- await composer.append(typescript());
74
- await composer.append(formatting());
102
+ composer.prepend(globalConfigs());
103
+ composer.append(typescriptConfigs());
104
+ composer.append(importConfigs());
105
+ composer.append(formattingConfigs());
75
106
  return composer;
76
107
  }
77
108
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielwaltz/eslint-config",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "license": "MIT",
5
5
  "author": "Daniel Waltz",
6
6
  "repository": {
@@ -19,7 +19,9 @@
19
19
  }
20
20
  },
21
21
  "files": [
22
- "dist"
22
+ "dist",
23
+ "README.md",
24
+ "CHANGELOG.md"
23
25
  ],
24
26
  "packageManager": "pnpm@9.15.0",
25
27
  "scripts": {
@@ -28,7 +30,8 @@
28
30
  "lint": "eslint .",
29
31
  "type-check": "tsc --noEmit",
30
32
  "prepack": "pnpm build",
31
- "release": "pnpm prepack && pnpx publint@latest && pnpx @arethetypeswrong/cli@latest --pack --profile esm-only && changelogen --release --push --publish && changelogen gh release"
33
+ "test": "pnpm prepack && pnpm lint && pnpm type-check && pnpx publint@latest && pnpx @arethetypeswrong/cli@latest --pack --profile esm-only",
34
+ "release": "pnpm test && changelogen --release --push --publish && changelogen gh release"
32
35
  },
33
36
  "peerDependencies": {
34
37
  "eslint": ">=9",
@@ -38,6 +41,8 @@
38
41
  "@eslint/js": "^9.16.0",
39
42
  "eslint-config-prettier": "^9.1.0",
40
43
  "eslint-flat-config-utils": "^0.4.0",
44
+ "eslint-import-resolver-typescript": "^3.7.0",
45
+ "eslint-plugin-import-x": "^4.5.0",
41
46
  "eslint-plugin-prettier": "^5.2.1",
42
47
  "typescript-eslint": "^8.17.0"
43
48
  },