Skip to content

Commit

Permalink
Merge pull request #161 from alleyinteractive/typescript-lint
Browse files Browse the repository at this point in the history
Add typescript type checking
  • Loading branch information
srtfisher authored Feb 22, 2023
2 parents 9b8096f + 8be7a22 commit 898f43a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
7 changes: 7 additions & 0 deletions entries/example-entry/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*---
Example Entry
---
@purpose
For example purposes only.
*/
2 changes: 2 additions & 0 deletions entries/example-entry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
* Entries are automatically built with webpack when included inside the
* ../entries directory. Enqueue in an entry index.php file or in src/assets.php
*/

import './index.scss';
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"build": "wp-scripts build --webpack-copy-php --webpack-src-dir=blocks",
"dev": "npm run start",
"create-block": "cd blocks && npx @wordpress/create-block --template ../bin/create-block --no-plugin",
"precheck-types": "check-node-version --package",
"check-types": "tsc",
"lint:fix": "eslint --ext .jsx --ext .js --ext .ts --ext .tsx . --fix",
"lint": "eslint --ext .jsx --ext .js --ext .ts --ext .tsx .",
"lint": "npm run check-types && eslint --ext .jsx --ext .js --ext .ts --ext .tsx .",
"postinstall": "rm -rf node_modules/.cache/babel-loader && rm -rf node_modules/.cache/webpack",
"prebuild": "check-node-version --package",
"predev": "check-node-version --package",
Expand Down
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
"jsx": "react-jsx",
"module": "es6",
"moduleResolution": "node",
"resolveJsonModule": true,
"noImplicitAny": true,
"outDir": "build",
"paths": {
"@/*": ["*"]
},
"target": "es5"
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "es2020"
},
"exclude": [
"vendor",
"node_modules",
"build/**/*"
]
}
}

0 comments on commit 898f43a

Please sign in to comment.