Prettier formats the code and the TypeScript compiler type checks, but neither are linters. Prettier is linter-like in the sense, it does the linting formatting rules part. However, for example TS nor Prettier will enforce using const or the no-console linting rules or how a variable is written, e.g. camelCase vs. PascalCase. This is why I'd recommend also using tslint.
I agree. I Have not made up my mind yet, thats why I am trying to understand what people do in similar project setup. Then i can also follow the same path.
Hey there, I'm Nick and this is my site's source code. This site started off as a clone of the Netlify CMS Gatsby Starter (check it out!). Since then, I've tweaked it a lot and converted the codebase to TypeScript.
Feel free to peruse the code and/or fork it. 😉
Thanks to all the wonderful projects that made it possible to build this blog.
clone the repository by running git clone git@github.com:nickytonline/www.iamdeveloper.com.git or git clone https://github.com/nickytonline/www.iamdeveloper.com.git
run npm install
run npm run develop to get up and running with the Gatsby development server.
Since the project uses Babel and not TypeScript as the compiler, a separate process is required to run type checking. Open another terminal and run npm run type-check:watch
If you're curious about why the Netlify CMS admin is…
Thats my basic question on why do I need
tslint? Typescript parser helps me detect all the code issues and prettier styles the code.Prettier formats the code and the TypeScript compiler type checks, but neither are linters. Prettier is linter-like in the sense, it does the linting formatting rules part. However, for example TS nor Prettier will enforce using
constor theno-consolelinting rules or how a variable is written, e.g. camelCase vs. PascalCase. This is why I'd recommend also using tslint.I agree. I Have not made up my mind yet, thats why I am trying to understand what people do in similar project setup. Then i can also follow the same path.
Update to this. I use eslint with TypeScript now. If you want to see my setup, check out
Source code for my web site iamdeveloper.com
iamdeveloper.com
Hey there, I'm Nick and this is my site's source code. This site started off as a clone of the Netlify CMS Gatsby Starter (check it out!). Since then, I've tweaked it a lot and converted the codebase to TypeScript.
Feel free to peruse the code and/or fork it.😉
Thanks to all the wonderful projects that made it possible to build this blog.
To get up and running:
git clone git@github.com:nickytonline/www.iamdeveloper.com.gitorgit clone https://github.com/nickytonline/www.iamdeveloper.com.gitnpm installnpm run developto get up and running with the Gatsby development server.npm run type-check:watchAlso, here's a great post from @robertcoopercode about TypeScript and ESLINT.
Using ESLint and Prettier in a TypeScript Project
Robert Cooper
Woot woot thanks for the shoutout.
@gyandeeps and I have been discussing whether using a linter is at all useful when combined with TypeScript. He doesn't seem convinced, haha.