Gathering detailed insights and metrics for typescript-plugin-css-modules-classnames
Gathering detailed insights and metrics for typescript-plugin-css-modules-classnames
Gathering detailed insights and metrics for typescript-plugin-css-modules-classnames
Gathering detailed insights and metrics for typescript-plugin-css-modules-classnames
npm install typescript-plugin-css-modules-classnames
Typescript
Module System
61.9
Supply Chain
96.8
Quality
74
Maintenance
25
Vulnerability
98.9
License
TypeScript (93.26%)
SCSS (2%)
CSS (1.22%)
JavaScript (1.05%)
Sass (0.99%)
Stylus (0.73%)
Less (0.66%)
Shell (0.1%)
Total Downloads
768
Last Day
1
Last Week
5
Last Month
10
Last Year
121
1,332 Stars
162 Commits
74 Forks
10 Watching
3 Branches
28 Contributors
Latest Version
1.0.5
Package Id
typescript-plugin-css-modules-classnames@1.0.5
Unpacked Size
15.64 kB
Size
5.43 kB
File Count
16
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
5
Compared to previous week
Last month
11.1%
10
Compared to previous month
Last year
16.3%
121
Compared to previous year
1
A TypeScript language service plugin for CSS Modules.
This project was inspired by this create-react-app
issue
and was based on css-module-types
.
To install with Yarn:
1yarn add typescript-plugin-css-modules
To install with npm:
1npm install --save typescript-plugin-css-modules
Once installed, add this plugin to your tsconfig.json
:
1{ 2 "compilerOptions": { 3 "plugins": [{ "name": "typescript-plugin-css-modules" }] 4 } 5}
Option | Default value | Description |
---|---|---|
customMatcher | "\\.module\\.(sa|sc|c)ss$" | Change the file extensions that this plugin works with. |
camelCase | false | Implements the behaviour of the camelCase CSS Loader option (accepting the same values). |
The below is an example that only matches "*.m.css" files, and camel-cases dashes.
1{ 2 "compilerOptions": { 3 "plugins": [ 4 { 5 "name": "typescript-plugin-css-modules", 6 "options": { 7 "customMatcher": "\\.m\\.css$", 8 "camelCase": "dashes" 9 } 10 } 11 ] 12 } 13}
By default, VSCode will use it's own version of TypeScript. To make it work with this plugin, you have two options:
"typescript.tsserver.pluginPaths"
in settings. Note that this method doesn't currently support
plugin options. This is planned for the November update.1{ 2 "typescript.tsserver.pluginPaths": ["typescript-plugin-css-modules"] 3}
tsconfig.json
file. For instructions, see: Using the workspace version of TypeScript.Note: Create React App users can skip this section if you're using react-scripts@2.1.x
or higher.
If your project doesn't already have global declarations for CSS Modules, you will need to add these to help TypeScript understand the general shape of the imported CSS during build.
Where you store global declarations is up to you. An example might look like: src/custom.d.ts
.
The below is an example that you can copy, or modify if you use a customMatcher
.
1declare module '*.module.css' { 2 const classes: { [key: string]: string }; 3 export default classes; 4} 5 6declare module '*.module.scss' { 7 const classes: { [key: string]: string }; 8 export default classes; 9} 10 11declare module '*.module.sass' { 12 const classes: { [key: string]: string }; 13 export default classes; 14}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 8
Reason
4 existing vulnerabilities detected
Details
Reason
Found 11/25 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More