Skip to content
This repository has been archived by the owner on Dec 6, 2020. It is now read-only.

TypeScript Language Service Plugin for CSS modules.

License

Notifications You must be signed in to change notification settings

timothykang/css-module-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

css-module-types

TypeScript Language Service Plugin for CSS modules.

Real-time autocompletion and validation of exports. Use alongside your build tool, such as webpack + css-loader or browserify + css-modulesify.

screenshot

Install

npm install --save-dev css-module-types

Usage

Add declaration to global.d.ts:

declare module '*.css' {
  const exports: { [exportName: string]: string };
  export = exports;
}

Add plugin to tsconfig.json:

{
  "compilerOptions": {
    "plugins": [ { "name": "css-module-types" } ],
    ...
  },
  "include": [
    "global.d.ts",
    ...
  ]
}

About

TypeScript Language Service Plugin for CSS modules.

Resources

License

Stars

Watchers

Forks

Packages

No packages published