Skip to content

docs: add about section with limitations and reasons #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ for [CSS Modules](https://github.com/css-modules/css-modules).
## Table of contents

- [typescript-plugin-css-modules](#typescript-plugin-css-modules)
- [Table of contents](#table-of-contents)
- [Table of contents](#about-this-plugin)
- [About this plugin](#table-of-contents)
- [Installation](#installation)
- [Importing CSS](#importing-css)
- [Options](#options)
Expand All @@ -28,6 +29,22 @@ for [CSS Modules](https://github.com/css-modules/css-modules).
- [Troubleshooting](#troubleshooting)
- [About this project](#about-this-project)

## About this plugin

This plugin provides type information to IDEs and any other tools that work with [TypeScript language service plugins](https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin#whats-a-language-service-plugin).

At this time, TypeScript does not support plugins during compilation. This means that this plugin cannot:

- provide errors during compilation, or
- add CSS module support to your project.

For more information, and/or to add support for this feature, see: https://github.com/microsoft/TypeScript/issues/16607.

If you need a different solution, these projects might help:

- For Jest support, see https://www.npmjs.com/package/jest-css-modules-transform (one of a few options).
- For Webpack configuration, see https://webpack.js.org/loaders/css-loader/#pure-css-css-modules-and-postcss for an example.

## Installation

To install with Yarn:
Expand All @@ -54,6 +71,8 @@ Once installed, add this plugin to your `tsconfig.json`:

If you're using Visual Studio Code, please also follow these [instructions](#visual-studio-code).

As Webpack configurations vary, you may need to provide additional [options](#options) to this plugin to match your project configuration. For Create React App users, this plugin will work without additional configuration.

### Importing CSS

A default export is always provided for your CSS module.
Expand Down