eslint-plugin-ai-rules 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +6 -13
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -21,7 +21,6 @@ Flat-config only ESLint plugin that bundles useful rules for AI-generated code.
21
21
  - Node `>=18` (`package.json` `engines`)
22
22
  - ESLint `^8.57.0 || ^9.0.0` (peer) — flat config requires ESLint 9
23
23
  - TypeScript `>=5.0.0` (peer)
24
- - `jiti` if you use `eslint.config.ts` (ESLint loads TS config via `jiti`)
25
24
 
26
25
  `@eslint/js`, `eslint-plugin-import-x`, `@stylistic/eslint-plugin`, `typescript-eslint`, `globals` are already `dependencies` — you don't need to install them.
27
26
 
@@ -41,11 +40,6 @@ pnpm add -D eslint-plugin-ai-rules eslint typescript
41
40
  bun add -d eslint-plugin-ai-rules eslint typescript
42
41
  ```
43
42
 
44
- > `jiti` is required only for `eslint.config.ts`. Install it as dev dep if you use TS config:
45
- > ```bash
46
- > npm i -D jiti
47
- > ```
48
-
49
43
  ## Quick Start
50
44
 
51
45
  ### `eslint.config.ts` (recommended)
@@ -233,11 +227,11 @@ Plugin itself uses `module: ESNext` + `moduleResolution: bundler` (`tsconfig.jso
233
227
 
234
228
  ## Troubleshooting
235
229
 
236
- **`jiti` is required for loading TypeScript configuration files**
230
+ **Missing `dist` before lint (repo uses `eslint.config.mjs` → `dist`)**
237
231
  ```
238
- Error: The 'jiti' library is required for loading TypeScript configuration files.
232
+ Error: Cannot find module './dist/index.js'
239
233
  ```
240
- Fix: `npm i -D jiti`
234
+ Fix: `npm run build` first. This repo's `eslint.config.mjs` imports from `dist` (no `jiti`), so `prelint` runs `build` automatically (`package.json` `prelint`).
241
235
 
242
236
  **File ignored because outside of base path**
243
237
  You passed an absolute path outside the config's `basePath`. Run `npx eslint .` from project root or use `npx eslint --no-config-lookup -c ./eslint.config.js ./src/file.ts` with correct cwd.
@@ -279,7 +273,7 @@ eslint-ai-guard/ # package: eslint-plugin-ai-rules
279
273
  │ ├── SortImports.ts # also exports getSortedContent
280
274
  │ └── index.ts
281
275
  ├── eslint/ # deprecated original implementations
282
- ├── eslint.config.ts # dogfooding: ...recommended + disable filename for src
276
+ ├── eslint.config.mjs # dogfooding: ...aiRules.configs.recommended from dist
283
277
  ├── tsconfig.json # ESNext/bundler, no .js extensions
284
278
  ├── tsup.config.ts # entry src/index.ts, format cjs+esm, dts, splitting:false
285
279
  ├── package.json # type module, exports ., files [dist]
@@ -299,9 +293,8 @@ eslint-ai-guard/ # package: eslint-plugin-ai-rules
299
293
 
300
294
  ```bash
301
295
  npm version patch|minor|major
302
- npm run build
303
- npm publish --access public
304
- # prepublishOnly runs build automatically
296
+ npm publish --access public # prepublishOnly runs verify (typecheck+build+lint+pack)
297
+ # or manually: npm run verify && npm publish --access public
305
298
  ```
306
299
 
307
300
  ## Legacy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-ai-rules",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "ESLint plugin com regras úteis para projetos com ESLint - AI Rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -21,9 +21,10 @@
21
21
  "prebuild": "npm run clean",
22
22
  "build": "tsup",
23
23
  "dev": "tsup --watch",
24
+ "prelint": "npm run build",
24
25
  "lint": "eslint .",
25
26
  "typecheck": "tsc --noEmit",
26
- "verify": "npm run typecheck && npm run lint && npm run build && npm pack --dry-run",
27
+ "verify": "npm run typecheck && npm run build && npm run lint && npm pack --dry-run",
27
28
  "prepack": "npm run build",
28
29
  "prepublishOnly": "git diff --quiet || (echo '✖ uncommitted changes — commit before publishing' && exit 1) && npm run verify",
29
30
  "postpublish": "echo '✔ published. Run: git push --follow-tags'"
@@ -53,7 +54,6 @@
53
54
  "devDependencies": {
54
55
  "@types/node": "^22.0.0",
55
56
  "eslint": "^9.0.0",
56
- "jiti": "^2.7.0",
57
57
  "tsup": "^8.0.0",
58
58
  "tsx": "^4.0.0",
59
59
  "typescript": "^5.6.0"