@acfatah/eslint-preset 1.3.5 → 1.4.1

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/README.md CHANGED
@@ -35,22 +35,23 @@ To install ESLint and this preset with Bun, run:
35
35
  bun add --dev eslint @acfatah/eslint-preset
36
36
  ```
37
37
 
38
- This preset declares `eslint`, `@antfu/eslint-config`, `@eslint/markdown`,
38
+ This preset declares `@antfu/eslint-config`, `@eslint/markdown`, `eslint`,
39
39
  `eslint-plugin-better-tailwindcss`, `eslint-plugin-format`, and
40
- `eslint-plugin-vue` as peer dependencies. Modern package managers, including
41
- Bun, will install these peers automatically when you add the preset, so you do
42
- not need to list each plugin manually in your `package.json`.
40
+ `eslint-plugin-vue` as dependencies. Bun, will install these packages
41
+ automatically when you add the preset, so you do not need to list each plugin
42
+ manually in your `package.json`.
43
43
 
44
44
  Add `eslint.config.ts` file with the following content. `config` is just a wrapper
45
45
  to the `antfu` factory function. See [antfu Customization][antfu-factory-fuction]
46
46
  section for more details.
47
47
 
48
48
  ```typescript
49
- import { config, markdown, preset, vue } from '@acfatah/eslint-preset'
49
+ import { defineConfig, markdown, preset, vue } from '@acfatah/eslint-preset'
50
50
 
51
- export default config(
51
+ export default defineConfig(
52
52
  {
53
- formatters: true,
53
+ formatters: true, // Optional since v1.4.0. Default to true.
54
+ typescript: true, // Optional since v1.4.0. Default to true.
54
55
 
55
56
  // Type of the project. 'lib' for libraries, the default is 'app'
56
57
  type: 'lib',
@@ -92,9 +93,9 @@ export default config(
92
93
  Add the following configurations respectively.
93
94
 
94
95
  ```typescript
95
- import { betterTailwindcssPlugin, config, tailwind } from '@acfatah/eslint-preset'
96
+ import { betterTailwindcssPlugin, defineConfig, tailwind } from '@acfatah/eslint-preset'
96
97
 
97
- export default config(
98
+ export default defineConfig(
98
99
  {
99
100
  // other configs...
100
101
  },
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
- import { default as config } from '@antfu/eslint-config';
3
+ import antfu from '@antfu/eslint-config';
4
4
 
5
+ export declare function defineConfig(options: Parameters<typeof antfu>[0], ...userConfigs: Parameters<typeof antfu>[1][]): import("eslint-flat-config-utils").FlatConfigComposer<import("@antfu/eslint-config").TypedFlatConfigItem, import("@antfu/eslint-config").ConfigNames>;
5
6
  export declare const betterTailwindcssPlugin: {
6
7
  "better-tailwindcss": {
7
8
  configs: {
@@ -92,7 +93,7 @@ export declare const vue: {
92
93
  };
93
94
 
94
95
  export {
95
- config,
96
+ defineConfig as config,
96
97
  };
97
98
 
98
99
  export {};
package/dist/index.mjs CHANGED
@@ -1,3 +1,12 @@
1
+ // src/define-config.ts
2
+ import antfu from "@antfu/eslint-config";
3
+ function defineConfig(options, ...userConfigs) {
4
+ return antfu({
5
+ formatters: true,
6
+ typescript: true,
7
+ ...options ?? {}
8
+ }, ...userConfigs);
9
+ }
1
10
  // src/plugins/better-tailwindcss.ts
2
11
  import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
3
12
  var betterTailwindcssPlugin = {
@@ -49,13 +58,12 @@ var vue = {
49
58
  allowAllPropertiesOnSameLine: true
50
59
  }]
51
60
  };
52
- // src/index.ts
53
- import { default as default2 } from "@antfu/eslint-config";
54
61
  export {
55
62
  vue,
56
63
  tailwind,
57
64
  preset,
58
65
  markdown,
59
- default2 as config,
66
+ defineConfig,
67
+ defineConfig as config,
60
68
  betterTailwindcssPlugin
61
69
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@acfatah/eslint-preset",
3
3
  "type": "module",
4
- "version": "1.3.5",
4
+ "version": "1.4.1",
5
5
  "description": "Eslint config preset.",
6
6
  "author": "Achmad F. Ibrahim <acfatah@gmail.com>",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "typecheck": "tsc --noEmit",
41
41
  "release": "bun run build && bunx --bun bumpp"
42
42
  },
43
- "peerDependencies": {
43
+ "dependencies": {
44
44
  "@antfu/eslint-config": "^6.7.3",
45
45
  "@eslint/markdown": "^7.5.1",
46
46
  "eslint": "^9.39.2",
@@ -50,17 +50,11 @@
50
50
  "jiti": "^2.6.1"
51
51
  },
52
52
  "devDependencies": {
53
- "@antfu/eslint-config": "^6.7.3",
54
53
  "@commitlint/cli": "^20.3.0",
55
54
  "@commitlint/config-conventional": "^20.3.0",
56
- "@eslint/markdown": "^7.5.1",
57
55
  "@types/bun": "^1.3.5",
58
56
  "bumpp": "^10.3.2",
59
57
  "bun-plugin-dts": "^0.3.0",
60
- "eslint": "^9.39.2",
61
- "eslint-plugin-better-tailwindcss": "^3.8.0",
62
- "eslint-plugin-format": "^1.2.0",
63
- "eslint-plugin-vue": "^10.6.2",
64
58
  "simple-git-hooks": "^2.13.1"
65
59
  },
66
60
  "simple-git-hooks": {