Skip to content

Commit 95e7b11

Browse files
committed
KTL-1241 chore: added dts generation for css module and validation via typescript
1 parent 2e12b64 commit 95e7b11

File tree

7 files changed

+165
-34
lines changed

7 files changed

+165
-34
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
public
2+
public
3+
*.css.d.ts

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ module.exports = {
3333
},
3434
plugins: ['@typescript-eslint', 'react', 'prettier', 'import', 'react-hooks'],
3535
rules: {
36-
indent: ['warn', 2],
36+
indent: 'off',
3737
'linebreak-style': ['error', 'unix'],
3838
quotes: ['error', 'single'],
3939
semi: ['error', 'always'],
40+
curly: ['error', 'all'],
4041
'react/react-in-jsx-scope': 'off',
4142
'import/order': ['error', { alphabetize: { order: 'asc' } }],
4243
'react-hooks/rules-of-hooks': 'error',
4344
'react-hooks/exhaustive-deps': 'warn',
4445
},
46+
ignorePatterns: ['*.js', '*.mjs'],
4547
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
public
44
.idea
55
.DS_Store
6+
*.css.d.ts

lint-staged.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
"src/**/**/*.{ts,tsx}": [
3+
"eslint --fix",
4+
() => "tsc --noEmit"
5+
],
6+
"src/**/**/*.{ts,tsx,css,scss}": [
7+
"prettier --write"
8+
]
9+
}

package.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,17 @@
77
"gatsby"
88
],
99
"scripts": {
10-
"start": "gatsby develop --port 8082",
10+
"start": "gatsby develop --port 8082 & tcm -w -c src",
1111
"build": "gatsby build --prefix-paths",
1212
"serve": "gatsby serve",
1313
"clean": "gatsby clean",
14-
"lint": "eslint --ext src/**/**/*.{ts,tsx}",
15-
"lint:fix": "eslint --fix --ext src/**/**/*.{ts,tsx}",
14+
"lint": "eslint --ext src/**/**/*.{ts,tsx} --quiet",
15+
"lint:fix": "eslint --fix --ext src/**/**/*.{ts,tsx} --quiet",
1616
"prettier": "prettier --write 'src/**/**/*.{ts,tsx,css,scss}'",
17+
"generate-css-types": "tcm -c src",
1718
"lint-staged": "lint-staged",
1819
"prepare": "husky install"
1920
},
20-
"lint-staged": {
21-
"src/**/**/*.{ts,tsx}": [
22-
"eslint --fix"
23-
],
24-
"src/**/**/*.{ts,tsx,css,scss}": [
25-
"prettier --write"
26-
]
27-
},
2821
"dependencies": {
2922
"@csstools/postcss-global-data": "^1.0.3",
3023
"@jetbrains/kotlin-web-site-ui": "^4.6.0",
@@ -90,6 +83,7 @@
9083
"postcss": "^8.4.21",
9184
"prettier": "^3.1.0",
9285
"prop-types": "^15.7.2",
86+
"typed-css-modules": "^0.8.1",
9387
"typescript": "^4.9.5",
9488
"typescript-plugin-css-modules": "^4.2.3"
9589
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{ "name": "typescript-plugin-css-modules" }
55
],
66
"jsx": "react-jsx",
7-
"esModuleInterop": true
7+
"esModuleInterop": true,
8+
"skipLibCheck": true
89
}
910
}

0 commit comments

Comments
 (0)