|
98 | 98 | git gc --prune=now # Garbage collect and prune unreachable objects |
99 | 99 |
|
100 | 100 | # echo "Installing ESLint dependencies..." |
101 | | - # npm install --save-dev eslint @eslint/js globals |
| 101 | + npm install --save-dev eslint @eslint/js globals |
| 102 | +
|
102 | 103 |
|
103 | 104 | # if [ ! -f "eslint.config.cjs" ]; then |
104 | 105 | # echo "Creating default ESLint config..." |
@@ -143,34 +144,36 @@ jobs: |
143 | 144 | rsync -av --delete ../upload-api/migration-sitecore/ ./upload-api/migration-sitecore/ |
144 | 145 |
|
145 | 146 | # Ensure tsconfig.json exists, create a default one if missing |
146 | | - if [ ! -f "tsconfig.json" ]; then |
147 | | - echo "Creating default tsconfig.json..." |
148 | | - cat <<EOL > tsconfig.json |
149 | | - { |
150 | | - "compilerOptions": { |
151 | | - "target": "ES6", |
152 | | - "module": "CommonJS", |
153 | | - "strict": true, |
154 | | - "esModuleInterop": true, |
155 | | - "skipLibCheck": true, |
156 | | - "forceConsistentCasingInFileNames": true |
157 | | - }, |
158 | | - "include": ["src/**/*"], |
159 | | - "exclude": ["node_modules", "dist"] |
160 | | - } |
161 | | - EOL |
162 | | - fi |
| 147 | + # if [ ! -f "tsconfig.json" ]; then |
| 148 | + # echo "Creating default tsconfig.json..." |
| 149 | + # cat <<EOL > tsconfig.json |
| 150 | + # { |
| 151 | + # "compilerOptions": { |
| 152 | + # "target": "ES6", |
| 153 | + # "module": "CommonJS", |
| 154 | + # "strict": true, |
| 155 | + # "esModuleInterop": true, |
| 156 | + # "skipLibCheck": true, |
| 157 | + # "forceConsistentCasingInFileNames": true |
| 158 | + # }, |
| 159 | + # "include": ["src/**/*"], |
| 160 | + # "exclude": ["node_modules", "dist"] |
| 161 | + # } |
| 162 | + # EOL |
| 163 | + # fi |
163 | 164 |
|
164 | 165 | # Remove unused imports |
165 | | - npx ts-remove-unused-imports api/ |
166 | | - npx ts-remove-unused-imports ui/ |
167 | | - npx ts-remove-unused-imports upload-api/ |
| 166 | + # npx ts-remove-unused-imports api/ |
| 167 | + # npx ts-remove-unused-imports ui/ |
| 168 | + # npx ts-remove-unused-imports upload-api/ |
168 | 169 |
|
169 | 170 | # Remove missing imports |
170 | | - npx ts-prune | grep -E '^(api/|ui/|upload-api/)/' | awk '{print $1}' | xargs -I {} sed -i '/import/d' {} |
| 171 | + # npx ts-prune | grep -E '^(api/|ui/|upload-api/)/' | awk '{print $1}' | xargs -I {} sed -i '/import/d' {} |
| 172 | +
|
| 173 | + # # Format code |
| 174 | + # npx prettier --write . |
171 | 175 |
|
172 | | - # Format code |
173 | | - npx prettier --write . |
| 176 | + eslint api/ ui/ upload-api/ --rule 'import/no-unresolved: error' --format compact | awk -F ':' '{print $1}' | sort -u | xargs -I {} sed -i '/import/d' {} |
174 | 177 |
|
175 | 178 | git add . |
176 | 179 | git commit -m "Sync changes from migration-v2 PR #${{ github.event.pull_request.number }}" |
|
0 commit comments