forked from gajus/babel-plugin-react-css-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Getting current to prep transitioning off #2
Open
lorenjohnson
wants to merge
64
commits into
Hylozoic:master
Choose a base branch
from
gajus:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…77) If a file only has import statements, the parser would crash when hot module reloading was enabled because firstNonImportDeclarationNode would be undefined. This makes those files work by adding the hot module block at the end of the file in those cases.
From #89 `Identifiers can't have quotes. If the key is supposed to be a string, it should be t.stringLiteral(name). Because it is an identifier it is an invalid AST.`
* Implemented support for extra postcss plugins * Added test for extra postcss plugins * Fixed eslint issues * Another fix of eslint * Fixed eslint * Removed string type of FiletypeOptions * Updated test to use latest syntax * Updated flow to 0.48.0 to use $ReadOnlyArray BREAKING CHANGE: Filetype is now an object with properties 'syntax' and 'plugins'
…run without requiring a syntax (#110)
…#116) * Fix the ajv-keywords "keyword select requires $data option" warning. * Disable the id-match eslint rule when configuring the ajv $data property. * Upgrade ajv to ^5.0.0. * style:
* Add .eslintignore for test fixtures The double quotes that the plugin adds go against the linting config of the project, and editors that auto-fix linting rules will try to convert quotes in `expected.js` files to single quotes, causing tests to fail. It seems safest to ignore all fixture files from linting. * Allow createObjectExpression to take a boolean * Allow getClassName to take an options argument The only option is to silence styleName errors, for example in production. If `silenceStyleNameErrors` is true, the styleNames which cannot be found will simply be removed from the resulting classNames, matching the behavior of `react-css-modules`. This commit alone will not result in a change in behavior, the next steps will be to pass in the option from the babel-plugin. * Add `silenceStyleNameErrors` to options schema * Pass silenceStyleNameErrors to getClassName This hooks up the options set by the user into getClassName, so that it has an effect. However, getClassName can also be used at runtime, which this commit does not address. * Provide silenceStyleNameErrors at runtime This commit adds the options object for getClassName iif silenceStyleNameErrors is true. By not always including the options object, it helps to save a few characters in the generated code. * Restructure Configuration docs Seeing the flow types first thing in the Configuration section was confusing to new users, so this adds a brief example of how to set babel plugin options, and moves the flow types underneath the table of options. * Add silenceStyleNameErrors to README * Loosen InputObjectType Flow was already not happy with using `InputObjectType` within its own definition, and was converting it to `{[key: string]: string | any}` when I inspected it in Nuclide. I’m honestly not sure how to specify a union type on an indexer as was being attempted, because flow complains as soon as you try to provide an object that has a property with a typed value. * Allow more options to handle missing styleNames This changes the option from a boolean “silenceStyleNameErrors” to an enum “handleMissingStyleName” option, with possible values of “throw” (default), “warn”, and “ignore”.
The default was not being set for non-namespaced styles. This caused a bug where errors were not thrown for runtime style names, since the options are not passed in if they are only the defaults.
Tests seem to pass, also tested locally and seems to work fine in a real project
This took me an age to work out.
* feat: add custom attribute mapping feature * style: fix extra spaces caused by formatter * style: fix eslint errrors * style: fix extra spaces again
* add ability to pass options to postcss plugins * add postcss plugin options usage docs into readme
* Added some notes on porting * docs: update wording
Adding documentation as requested in #108 (comment)
removed a double 'several several' typo
* fix: update test fixtures Fixes #211 * chore: assert exception on use with missing import
BREAKING CHANGE: * babel 7 requirement
BREAKING CHANGE: * exclude logic is used to exclude JSXElement containing files
* fix: cannot read property 'split' of undefined * fix: lint error in getClassName * fix: lint error in getClassName
* fix: cannot read property 'split' of undefined * fix: lint error in getClassName * fix: lint error in getClassName * test: add test case for absolute import
…te (#230) * feat: add skipAbsentStyleName * test: add test case for skipAbsentStyleName * feat: refactor skipAbsentStyleName traversal * fix: readd require.resolve for resource path * feat: update options naming * docs: update for skip option * refactor: traverse JSXAttribute instead of element
* feat: add autoResolveMultiImports option * test: add test cases for autoResolveMultiImports option * docs: add for autoResolveMultiImports option
The links to webpack's documents on hot module reloading was out of date
* fix: handle spread * test: handle spread * test: add test case for spread * spread: remove keys exclusion, avoid falsy values * refactor: handle spread separated in another file
* feat: use RegExp as including condition in filetype config * test: add corresponding test cases. * fix: do not use extension-style filrtype as RegExp pattern * feat: modify the priority between RegExp pattern filetype and extension style filetype * style: no continue * style: for comment #2 Co-authored-by: super-cattle <xuxinhang4567#126.com>
…on of generateScopedName.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.