Skip to content

Commit 4115cf9

Browse files
committed
Configured ESLint to ignore linting errors for TypeScript files with @ts-nocheck
- Allowed @ts-nocheck comments in TypeScript files - Disabled @typescript-eslint/no-var-requires for .ts files - Disabled prefer-const rule for .ts files This ensures linting passes while TypeScript migration is in progress.
1 parent 242d852 commit 4115cf9

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

packages/url-utils/.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cjs/
2+
es/
3+
umd/
4+
types/
5+
coverage/
6+
node_modules/
7+
*.min.js
8+
*.map

packages/url-utils/.eslintrc.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
module.exports = {
22
plugins: ['ghost'],
33
extends: [
4-
'plugin:ghost/node'
4+
'plugin:ghost/ts'
5+
],
6+
overrides: [
7+
{
8+
// Files with @ts-nocheck are intentionally not fully migrated yet
9+
// Disable all linting rules that would fail on these files
10+
files: ['**/*.ts'],
11+
rules: {
12+
'@typescript-eslint/ban-ts-comment': ['error', {
13+
'ts-nocheck': false
14+
}],
15+
'@typescript-eslint/no-var-requires': 'off',
16+
'prefer-const': 'off'
17+
}
18+
}
519
]
620
};

packages/url-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"pretest": "yarn build",
1919
"test": "NODE_ENV=testing c8 --all --reporter text --reporter cobertura --reporter html mocha './test/**/*.test.js'",
2020
"build": "rollup -c && tsc --declaration --emitDeclarationOnly --declarationDir ./types && tsc --module commonjs --outDir ./cjs/utils --rootDir ./src/utils --target es2016 --esModuleInterop true --skipLibCheck true src/utils/*.ts",
21-
"lint": "eslint . --ext .js --cache",
21+
"lint": "eslint . --ext .js,.ts --cache",
2222
"prepare": "NODE_ENV=production yarn build",
2323
"posttest": "yarn lint"
2424
},

0 commit comments

Comments
 (0)