Giter VIP home page Giter VIP logo

typed-css-modules's Introduction

typed-css-modules github actions npm version

Creates TypeScript definition files from CSS Modules .css files.

If you have the following css,

/* styles.css */

@value primary: red;

.myClass {
  color: primary;
}

typed-css-modules creates the following .d.ts files from the above css:

/* styles.css.d.ts */
declare const styles: {
  readonly primary: string;
  readonly myClass: string;
};
export = styles;

So, you can import CSS modules' class or variable into your TypeScript sources:

/* app.ts */
import styles from './styles.css';
console.log(`<div class="${styles.myClass}"></div>`);
console.log(`<div style="color: ${styles.primary}"></div>`);

CLI

npm install -g typed-css-modules

And exec tcm <input directory> command. For example, if you have .css files under src directory, exec the following:

tcm src

Then, this creates *.css.d.ts files under the directory which has the original .css file.

(your project root)
- src/
    | myStyle.css
    | myStyle.css.d.ts [created]

output directory

Use -o or --outDir option.

For example:

tcm -o dist src
(your project root)
- src/
    | myStyle.css
- dist/
    | myStyle.css.d.ts [created]

file name pattern

By default, this tool searches **/*.css files under <input directory>. If you can customize the glob pattern, you can use --pattern or -p option. Note the quotes around the glob to -p (they are required, so that your shell does not perform the expansion).

tcm -p 'src/**/*.css' .

watch

With -w or --watch, this CLI watches files in the input directory.

validating type files

With -l or --listDifferent, list any files that are different than those that would be generated. If any are different, exit with a status code 1.

camelize CSS token

With -c or --camelCase, kebab-cased CSS classes(such as .my-class {...}) are exported as camelized TypeScript variable name(export const myClass: string).

You can pass --camelCase dashes to only camelize dashes in the class name. Since version 0.27.1 in the webpack css-loader. This will keep upperCase class names intact, e.g.:

.SomeComponent {
  height: 10px;
}

becomes

declare const styles: {
  readonly SomeComponent: string;
};
export = styles;

See also webpack css-loader's camelCase option.

named exports (enable tree shaking)

With -e or --namedExports, types are exported as named exports as opposed to default exports. This enables support for the namedExports css-loader feature, required for webpack to tree shake the final CSS (learn more here).

Use this option in combination with https://webpack.js.org/loaders/css-loader/#namedexport and https://webpack.js.org/loaders/style-loader/#namedexport (if you use style-loader).

When this option is enabled, the type definition changes to support named exports.

NOTE: this option enables camelcase by default.

.SomeComponent {
  height: 10px;
}

Standard output:

declare const styles: {
  readonly SomeComponent: string;
};
export = styles;

Named exports output:

export const someComponent: string;

arbitrary file extensions

With -a or --allowArbitraryExtensions, output filenames will be compatible with the "arbitrary file extensions" feature that was introduce in TypeScript 5.0. See the docs for more info.

In essence, the *.css.d.ts extension now becomes *.d.css.ts so that you can import CSS modules in projects using ESM module resolution.

API

npm install typed-css-modules
import DtsCreator from 'typed-css-modules';
let creator = new DtsCreator();
creator.create('src/style.css').then(content => {
  console.log(content.tokens); // ['myClass']
  console.log(content.formatted); // 'export const myClass: string;'
  content.writeFile(); // writes this content to "src/style.css.d.ts"
});

class DtsCreator

DtsCreator instance processes the input CSS and creates TypeScript definition contents.

new DtsCreator(option)

You can set the following options:

  • option.rootDir: Project root directory(default: process.cwd()).
  • option.searchDir: Directory which includes target *.css files(default: './').
  • option.outDir: Output directory(default: option.searchDir).
  • option.camelCase: Camelize CSS class tokens.
  • option.namedExports: Use named exports as opposed to default exports to enable tree shaking. Requires import * as style from './file.module.css'; (default: false)
  • option.allowArbitraryExtensions: Output filenames that will be compatible with the "arbitrary file extensions" TypeScript feature
  • option.EOL: EOL (end of line) for the generated d.ts files. Possible values '\n' or '\r\n'(default: os.EOL).

create(filepath, contents) => Promise(dtsContent)

Returns DtsContent instance.

  • filepath: path of target .css file.
  • contents(optional): the CSS content of the filepath. If set, DtsCreator uses the contents instead of the original contents of the filepath.

class DtsContent

DtsContent instance has *.d.ts content, final output path, and function to write the file.

writeFile(postprocessor) => Promise(dtsContent)

Writes the DtsContent instance's content to a file. Returns the DtsContent instance.

  • postprocessor (optional): a function that takes the formatted definition string and returns a modified string that will be the final content written to the file.

    You could use this, for example, to pass generated definitions through a formatter like Prettier, or to add a comment to the top of generated files:

    dtsContent.writeFile(definition => `// Generated automatically, do not edit\n${definition}`);

tokens

An array of tokens is retrieved from the input CSS file. e.g. ['myClass']

contents

An array of TypeScript definition expressions. e.g. ['export const myClass: string;'].

formatted

A string of TypeScript definition expressions.

e.g.

export const myClass: string;

messageList

An array of messages. The messages contain invalid token information. e.g. ['my-class is not valid TypeScript variable name.'].

outputFilePath

Final output file path.

Remarks

If your input CSS file has the following class names, these invalid tokens are not written to output .d.ts file.

/* TypeScript reserved word */
.while {
  color: red;
}

/* invalid TypeScript variable */
/* If camelCase option is set, this token will be converted to 'myClass' */
.my-class {
  color: red;
}

/* it's ok */
.myClass {
  color: red;
}

Example

There is a minimum example in this repository example folder. Clone this repository and run cd example; npm i; npm start.

Or please see https://github.com/Quramy/typescript-css-modules-demo. It's a working demonstration of CSS Modules with React and TypeScript.

License

This software is released under the MIT License, see LICENSE.txt.

typed-css-modules's People

Contributors

abendi avatar akshayas avatar dacevedo12 avatar dkamyshov avatar evoactivity avatar gdelmas avatar ignusg avatar irico3 avatar jfurfaro avatar mishrasamiksha avatar mtsmfm avatar muuki88 avatar ncochard avatar olegstepura avatar parth4git avatar quramy avatar radziksh avatar realmunk avatar renovate-bot avatar renovate[bot] avatar rodrigojcmello avatar rohan37kumar avatar tgelu-db avatar timluo465 avatar tomdye avatar vyorkin avatar wkich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

typed-css-modules's Issues

Can this be a TypeScript plugin?

I'm not familiar with TypeScript plugins as much as you are. You wrote one but I was wondering if this can become a TypeScript plugin that extends module resolution to CSS files?

Can't find Typed CSS module inside Test case (Karma-Webpack, Mocha, Enzyme, Chai)

I have written the following test case:

import React from 'react';
import _ from 'lodash';
import { FileMenu } from '../../../src/components/FileMenu/FileMenu';
import {render, shallow, mount} from 'enzyme';
import {expect} from 'chai';
import chaiEnzyme from 'chai-enzyme'
chai.use(chaiEnzyme()) // Note the invocation at the end

describe('FileMenu', () => {

  it('Has an Item Class', () => {
    const wrapper = render(<FileMenu />);
    expect(wrapper.find('.item')).to.exist.and.have.length(1);
  });

});`

Running Karma I receive the following error:

23 01 2017 16:46:18.489:INFO [launcher]: Starting browser Chrome
23 01 2017 16:46:19.353:INFO [Chrome 55.0.2883 (Mac OS X 10.11.4)]: Connected on socket 4K2ul5zXPP_-1g5hAAAA with id 52768413
Chrome 55.0.2883 (Mac OS X 10.11.4) ERROR
Uncaught Error: Cannot find module "./FileMenu.css"
at test/components/FileMenu/FileMenuTest.tsx:12422

FileMenu already has a FileMenu.css.d.ts file that was generated in the same directory. I'm confused as to why the CSS reference cannot be resolved.

bug: -p behaves weird

I'm on Windows 10.

tcm -p "**/*.css" -w doesn't see any path, doesn't watch, doesn't do anything.

tcm -p "client/**/*.css" -w works.

Synchronously create files

Is there a way to synchronously create the .d.ts files? I'm using this module with webpack and need to generate these files before I run the TypeScript compiler.

webpack build errors on @value line

I have css-modules files that import constants from other files using @value. I get many build errors on these that might be good to suppress, as they should not come out in the declarations anyway. The declaration seems to build fine, but there are just so many errors produced.

ERROR in ./src/admin/AlertDashboard.css
Module parse failed: /Users/paul/dev/anywhere/anywhere-com/node_modules/typed-css-modules-loader/index.js?outDir=/gen-src!/Users/paul/dev/anywhere/anywhere-com/src/admin/AlertDashboard.css Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @value light_grey, light_blue, dark_grey, orange from 'anywhere/css/shared/colors.css';
|

Less support?

Does it support less, or how can it be modified to?

Feature request: Add content parameter to DtsCreator.create

We use Webpack to build our css and we want to use typed-css-modules to create type definitions for it. But we also use scss and typed-css-modules fails on scss specific syntax which makes this promise fail: https://github.com/Quramy/typed-css-modules/blob/master/src/dtsCreator.js#L94 with a CssSyntaxError and Unknown word for thinks like max-height: #{$base-line-height * $line-count}rem;.

When we call DtsCreator.create() we have both the path to the file, and the contents of the file transformed from scss to css. We'd like to be able to pass a second argument to DtsCreator.create() with the contents of the file and not have typed-css-modules read it from the file since it contains invalid css syntax.

Btw, thanks for a great module!

npm fail with: cd example && npm i

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Linux 3.13.0-83-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.1.0
npm ERR! npm  v3.10.9
npm ERR! path /home/davidm/src/Quramy/typed-css-modules/example/node_modules/typed-css-modules/lib/cli.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/home/davidm/src/Quramy/typed-css-modules/example/node_modules/typed-css-modules/lib/cli.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/davidm/src/Quramy/typed-css-modules/example/node_modules/typed-css-modules/lib/cli.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /home/davidm/src/Quramy/typed-css-modules/example/npm-debug.log

Issues when generated empty files

Typescript seems to complain with empty file. For example with a css file which only contains global declarations.

It may be great to just add a /* empty */ comment to prevent errors in rollup builds (for example) :
image

Thanks ! Your plugin is amazing !

Feature request: expose hook to resolve imports/composes

When using this module with Webpack I get an error because typed-css-modules tries to resolve an import/composes path but we have custom path handling in Webpack so typed-css-modules won't be able to resolve it.

Would you mind exposing a hook to let the user of the module resolve paths?

Does it manage multiple directory in any way ?

Hey there,

I like a lot this plugin, and i wonder if it's possible to pass multiples input directories in some way ?

For now i does something like :

tcm . --pattern ./common/**/*.scss ; tcm . --pattern ./formats/**/*.scss

But is there something like this followings i missed ?

tcm . --pattern ./common/**/*.scss --pattern ./formats/**/*.scss
// or 
tcm ./common ./formats --pattern ./**/*.scss

The real problem here, is for --watch

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

-w worked not very well in win7

Reporting a Bug

What is the current behavior?

Dir
|- src
  |- components
    |- user
      |- index.css
CLI

tcm src -w -c -p components/user/index.css

It's work well. "index.css.d.ts" created.

tcm src -w -c or tcm src -w -c /**/*.css

no files created.

What is the expected behavior?

excu tcm src -w -c. "index.css.d.ts" created.

Reason

path transfer happen in chokidar. The path sep should '/', not '\\'
I created a pr for this. please check it. tks.

Expose errors when parsing CSS

Right now the module silently fails with the .create Promise not returning when there are errors. When used with webpack this holds up the build process because webpack waits for the Promise to return before moving on to other steps.

Could you expose any errors through the API please?

Add hover to a class

What is the best way to add .input:hover { -- some css code here --}? Right now I have svolved it with creating an own .inputHover:hover class that I append to my React component trough classNames. Just wondering if there is a more elegant way to achieve this.

Thanks for this!

Unknown word error occurs on double slashed comments

Hello,

I am trying to parse my sass files but when I insert a comment with double slash or a javascript file reference for intellisense in Visual Studio 2017 I am getting the error I mentioned below.

/* Comment that working well */
// This comment will couse an error

My main objective is use the reference paths actually. Comments are not that important I can use the /**/ syntax anyways.

tcm -o lib -p ./**/*.scss src
[Error] CssSyntaxError: C:\C:\src\Component\assets\style.scss:1:1: Unknown word
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser

1 | /// <reference path="../../stylesheets/main.scss" / >
.. | ^
2 |
3 | @import 'mainstyles';`

Add dropExtension support

We're using css-modules as part of the dojo 2 widget system but we import our .css files without an extension such that webpack can resolve to the .json file instead when building.
It would be beneficial to add support to typed-css-modules to drop the input file extension for this purpose.

ie.
inputFilePath: path/to/file.css
outputFilePath: path/to/file.d.ts

TypeError: Cannot read property 'forEach' of undefined

After upgrading from 0.3.7 to 0.4.0 I'm getting this error message for each file processed by tcm:

[Error] TypeError: Cannot read property 'forEach' of undefined

I've reproduced this in a fresh project with only the following file, src/test.css:

.hello {
  background-color: red;
}

then running tcm src I get the error:

Wrote /Users/tom/code/foo/src/test.css.d.ts
[Error] TypeError: Cannot read property 'forEach' of undefined

If more CSS files are added, an error is printed after processing each one.

webpack2 problems

Thanks for the library!

Originally posted olegstepura/typed-css-modules-loader#10

Stack

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5!./~/sass-loader?sourceMap!./~/typed-css-modules!./~/sass-loader!./src/sass/main.scss
Module build failed: TypeError: Cannot call a class as a function
    at _classCallCheck (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/typed-css-modules/lib/dtsCreator.js:46:99)
    at Object.DtsCreator (/home/cescoferraro/code/go/src/github.com/cescoferraro/spotify/node_modules/typed-css-modules/lib/dtsCreator.js:123:5)
 @ ./src/sass/main.scss 4:14-312
 @ ./src/ts/shell.tsx
 @ ./src/ts/app.tsx

preloader

{
            enforce: 'pre',
            test: /\.scss$/,
            exclude: /node_modules/,
            loaders: ['typed-css-modules', 'sass-loader']
        }

Auto convert kebab-case to camelCase

css module accepts kebab-case classes, and converts them to camelCase classes, for the same reason that javascript does not accept kebab-case variable.
You can, and should use: https://www.npmjs.com/package/camelcase

My suggestion is to auto-convert kebab-case classes to camelCase variables in the d.ts

for example:

left-panel {
  width: 30%
}

Should be converted to:

<SideBar className={css.leftPanel}/>

Cannot find module 'gaze'

I'm just trying to run the example with cd example && npm i && npm start but I'm getting this error:

Error: Cannot find module 'gaze'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/testerez/projects/trash/typed-css-modules/lib/cli.js:10:13)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)

I tried after npm i gaze, same error...

Using npm 3.8.5 and node v4.4.2

The TypeScript typing is not compatible with ES import syntax

In the distributed .d.ts, the DtsCreator is exported via export =, which is incompatible with the standard ES import syntax. The consumer of the library needs to import via TypeScript specific import DtsCreator = require('typed-css-modules').

Only write file if it's changed

Feature request: only write the output file if the generated content differs than what's currently in the file.

This might seem like a silly optimization, but in my case I'm trying to avoid an annoying issue with webpack watch where newly created files cause it to get stuck in a re-compile loop for 10 seconds. The suggested fix is to back time-stamp the files after creation, but that isn't too feasible for typed-css-modules when you generate 300 files during startup. :)

I'd be willing to take a crack at a PR for this if you're open to the idea.

Extended types in generated `.d.ts` files

Issue

Right now it's impossible to get a styles value using an indexer:

/**
  * a css file
  */

.root {}
.dark {}
.light {}
/**
  * a ts file using the declared styles
  */

import * a styles from './styles.css'
import * as cn from 'classnames'
...
type Theme = 'dark' | 'light'
const theme: Theme = 'dark'

// this doesn't work
const className = cn(styles.root, {
  [styles[theme]]: true,
})

// this works
const className = cn(styles.root, {
  [styles.dark]: theme === 'dark',
  [styles.light]: theme === 'light',
})

The first snippet doesn't work because of an error:

ERROR in ./src/components/atoms/Component.tsx
(22,12): error TS7017: Element implicitly has an 'any' type because type 'typeof "/Users/puelle/Projects/test/style_typings/atoms/Component.css"' has no index signature.

Possible resolution

To generate kind of extended styles typings:

/**
  * a generated .d.ts file
  */

interface FilenameStyles {
  dark: string;
  light: string;
}

const typedStyles: Record<keyof FilenameStyles, string> = styles
// to preserve `import * as styles from ...` behaviour
export = typedStyles
// to create a default export (`import styles from ...`)
export default typedStyles

tslint: file should end with a newline

With the linting rules that we have setup, tslint wants us to end things with a newline. Any chance a config option could be added for those who need/want to end things with a newline?

0.4.2 Generates exports that are not picked up by vscode autocomplete

I have been using 0.3.7 up until now, which generated typings like this:

export const firstStyle: string;
export const otherStyle: string;

Now I tried to update to 0.4.2 which generates typings like this:

declare const styles: {
  readonly "firstStyle": string;
  readonly "otherStyle": string;
};
export = styles;

Is there an option to generate the typings like the older version? The newer one's exports are not picked up by VSCode's autocomplete, which was the biggest benefit for me besides not messing up class names accidentally.

How to use with parcel?

hi,

thanks for your great plugin, it solves the problem of importing scss files into typescript components perfectly.

Is it possible to use your plugin with parceljs as well?

way to ignore specific css script while running tcm?

I made a npm run command, "generate:css": "node_modules/.bin/tcm src",
the problem is for one of my CSS I'm including with my project I'm treating as a global import, importing it like so since I'm using TypeScript, import '!style!css!./Blotter.css';
Now when tcm src gets run, I get a bunch of warnings for this file

`[Warn] ag-flat is not valid TypeScript variable name.
[Warn] ag-root is not valid TypeScript variable name.
[Warn] ag-cell-not-inline-editing is not valid TypeScript variable name.
[Warn] ag-cell-range-selected-1 is not valid TypeScript variable name.
[Warn] ag-cell-focus is not valid TypeScript variable name.
[Warn] ag-cell-range-selected-2 is not valid TypeScript variable name.
[Warn] ag-cell-range-selected-3 is not valid TypeScript variable name.
[Warn] ag-cell-range-selected-4 is not valid TypeScript variable name.
[Warn] ag-column-moving is not valid TypeScript variable name.
[Warn] ag-cell is not valid TypeScript variable name.
[Warn] ag-header-cell is not valid TypeScript variable name.`

Is there anything I can put at the beginning of my CSS so that tcm will ignore it?
Or should I affix the :global selector in front of every single style in the stylesheet (and import it normally)?

thanks!!!

css file imported as string?

I install and run the module as expected, indeed the .d.ts file is successfully created.

My sample project structure is the following:
ps

In the src folder I have
src

In feature-viewer.ts I import
import * as teststyles from './assets/testcss.css';

testcss.css (as in example)
/* styles.css */ @value primary: red; .myClass { color: primary; }

The .d.ts files in assets are generated by typed-css-modules execution and indeed the IDE is now able to access the css properties e.g. testcss.myClass.
schermata

However the styling still does not work because all values are undefined.
Indeed the value of teststyles.myClass, if printed, is undefined.
Instead, teststyles, if printed, is

/* styles.css */
@value primary: red;
.myClass {
color: primary;
}

Basically a string of the file content. Shouldn't it be some kind of object?

Cannot find module './DtsCreator'

works well with 0.4.2,fail with 0.5.0

check the logs below
$ npm install -g typed-css-modules
...
$ ls /opt/node/lib/node_modules/typed-css-modules/lib/
DtsContent.d.ts
DtsContent.js
DtsCreator.d.ts
FileSystemLoader.d.ts
cli.d.ts
cli.js
dtsCreator.js
fileSystemLoader.js
index.d.ts
index.js
tokenValidator.js
$ export DONT_INSTALL_HOOKS=true
$ tcm --pattern ./packages/**/*.module.scss -c
module.js:550
throw err;
^

Error: Cannot find module './DtsCreator'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/opt/node/lib/node_modules/typed-css-modules/lib/cli.js:27:22)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)

Outdated dependencies

Installing the modules gives me a few dependency warnings, that could be fixed:

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

Excluding pattern

Is there any way to exclude files from the search? I tried:

tcm -p src/**/(!*.global)*.css

But it does not seem to work.

Accents in css

Words with accets in css (like análise, concluído, ônibus) are ignored :(

(TypeScrip, JavaScript and CSS supports accents)

quoted identifers

I'm using typed-css-modules-webpack-plugin in a couple projects and it's actually using typed-css-modules to create .css.d.ts files. The issue is that one of the projects produces non-quoted-identifers while the other project produces quoted identifiers and I haven't found what is telling it which way to create them. Is it a setting in a file somewhere?
Example one might create:

declare const styles: {
  readonly "linkStyle": string;
};
export = styles;

while the other will not have the quotes. Any idea?

WebPack loader

Have you consider making this a WebPack loader so it can work on any transformed CSS (we're using cssnext)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.