@express-zod-api/migration 26.0.0 → 27.0.0-beta.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/index.js +3 -2
- package/package.json +2 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -18,6 +18,6 @@ import migration from "@express-zod-api/migration";
|
|
|
18
18
|
|
|
19
19
|
export default [
|
|
20
20
|
{ languageOptions: { parser }, plugins: { migration } },
|
|
21
|
-
{ files: ["**/*.ts"], rules: { "migration/
|
|
21
|
+
{ files: ["**/*.ts"], rules: { "migration/v27": "error" } },
|
|
22
22
|
];
|
|
23
23
|
```
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{AST_NODE_TYPES as e,ESLintUtils as t}from"@typescript-eslint/utils";const n={
|
|
2
|
-
|
|
1
|
+
import{AST_NODE_TYPES as e,ESLintUtils as t}from"@typescript-eslint/utils";const n={integration:`${e.NewExpression}[callee.name="Integration"] > ${e.ObjectExpression}`},r=t=>t.type===e.Property&&!t.computed&&(t.key.type===e.Identifier||t.key.type===e.Literal&&typeof t.key.value==`string`),i=t=>t.key.type===e.Identifier?t.key.name:t.key.value,a=e=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[n[r]]:e[r]}),{}),o=`v${`27.0.0-beta.1`?.split(`.`)[0]??`0`}`,s=t.RuleCreator.withoutDocs({name:o,meta:{type:`problem`,fixable:`code`,schema:[],messages:{change:`change {{ subject }} from {{ from }} to {{ to }}`,add:`add {{ subject }} to {{ to }}`,move:`move {{ subject }} to {{ to }}`,remove:`remove {{ subject }}`}},defaultOptions:[],create:t=>a({integration:n=>{if(n.properties.filter(r).find(e=>i(e)===`typescript`))return;let a=t.sourceCode.getAncestors(n).some(t=>t.type===e.AwaitExpression||(t.type===e.ArrowFunctionExpression||t.type===e.FunctionExpression||t.type===e.FunctionDeclaration)&&t.async);t.report(a?{node:n.parent,messageId:`change`,data:{subject:`constructor`,from:`new Integration()`,to:`await Integration.create()`},fix:e=>e.replaceText(n.parent,`(await Integration.create(${t.sourceCode.getText(n)}))`)}:{node:n,messageId:`add`,data:{subject:`typescript property`,to:`constructor argument`},fix:e=>[e.insertTextBeforeRange(t.sourceCode.ast.range,`import typescript from "typescript";
|
|
2
|
+
|
|
3
|
+
`),n.properties.length?e.insertTextBefore(n.properties[0],`typescript, `):e.replaceText(n,`{ typescript }`)]})}})});var c={rules:{[o]:s}};export{c as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@express-zod-api/migration",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.0-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Migration scripts for express-zod-api",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"typescript-eslint": "^8.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
39
|
+
"@typescript-eslint/rule-tester": "^8.51.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"pretest": "tsc",
|