spidy88 / lint-staged-tsc Goto Github PK
View Code? Open in Web Editor NEWA simple tool to run tsc against staged files only, ignore errors in other files
License: MIT License
A simple tool to run tsc against staged files only, ignore errors in other files
License: MIT License
I will try to add kind of the environment I am working on right now:
it's a NextJS
project using typescript, NextJS
is version 12.3.
Typescript: "typescript": "5.4.5"
tsconfig.json
{
"compilerOptions": {
"target": "ES2015",
"baseUrl": ".",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": false,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "preserve",
"paths": {
"@components/*": ["src/components/*"],
"@hooks/*": ["src/hooks/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "svgo.config.js"]
}
related packages versions: (not full package.json)
{
"@spidy88/lint-staged-tsc": "^1.0.0",
"tsc-files": "^1.1.4",
"husky": "7.0.2",
"lint-staged": "^15.2.2",
}
I am using babel
at the moment to get code test coverage using istanbul
;
.babelrc file in root.
{
"presets": ["next/babel"],
"env": {
"development": {
"plugins": ["istanbul"]
}
}
}
And this is the error:
โ lint-staged-tsc --noEmit --strict:
xxxxxxxxxxx\node_modules\@spidy88\lint-staged-tsc\cli.js:26
const outputLines = stdout.toString().split(/[\r\n]+/);
^
TypeError: Cannot read properties of null (reading 'toString')
at Object.<anonymous> (xxxxxxxxxxxxxxxxxxxxx\node_modules\@spidy88\lint-staged-tsc\cli.js:26:28)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
Node.js v20.10.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.