Skip to content

Commit 969059c

Browse files
committed
Merge branch 'release/1.0.2'
2 parents 84cbe95 + 984d693 commit 969059c

File tree

8 files changed

+154
-22
lines changed

8 files changed

+154
-22
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team (see [`package.json`](https://github.com/mrmckeb/typescript-plugin-css-modules/blob/master/package.json) for contact information). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
labels:
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
13+
1. Go to '...'
14+
2. Click on '....'
15+
3. Scroll down to '....'
16+
4. See error
17+
18+
**Expected behavior**
19+
A clear and concise description of what you expected to happen.
20+
21+
**Screenshots**
22+
If applicable, add screenshots to help explain your problem.
23+
24+
**Desktop (please complete the following information):**
25+
26+
- OS: [e.g. iOS]
27+
- Browser [e.g. chrome, safari]
28+
- Version [e.g. 22]
29+
30+
**Smartphone (please complete the following information):**
31+
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
labels:
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.
File renamed without changes.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
A [TypeScript language service plugin](https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin)
77
for [CSS Modules](https://github.com/css-modules/css-modules).
88

9-
<img src="https://raw.githubusercontent.com/mrmckeb/typescript-plugin-css-modules/master/docs/images/example.gif" alt="typescript-plugin-css-modules example" />
9+
<img src="https://raw.githubusercontent.com/mrmckeb/typescript-plugin-css-modules/master/.github/images/example.gif" alt="typescript-plugin-css-modules example" />
1010

1111
This project was inspired by this [`create-react-app` issue](https://github.com/facebook/create-react-app/issues/5677)
1212
and is based on [`css-module-types`](https://github.com/timothykang/css-module-types).
@@ -73,8 +73,7 @@ By default, VSCode will use it's own version of TypeScript. To make it work with
7373
}
7474
```
7575

76-
2. Use your workspace's version of TypeScript, which will load the plugins from your `tsconfig.json` file.
77-
([instructions](https://code.visualstudio.com/docs/languages/typescript#_using-the-workspace-version-of-typescript)).
76+
2. Use your workspace's version of TypeScript, which will load the plugins from your `tsconfig.json` file. For instructions, see: [Using the workspace version of TypeScript](https://code.visualstudio.com/docs/languages/typescript#_using-the-workspace-version-of-typescript).
7877

7978
### Custom definitions
8079

@@ -102,3 +101,5 @@ declare module '*.module.sass' {
102101
export default classes;
103102
}
104103
```
104+
105+
## Contributors

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-plugin-css-modules",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"main": "lib/index.js",
55
"author": "Brody McKee <[email protected]>",
66
"license": "MIT",

src/index.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,25 @@ function init({ typescript: ts }: { typescript: typeof ts_module }) {
7171
containingFile,
7272
reusedNames,
7373
) => {
74-
const resolvedCSS: ts.ResolvedModuleFull[] = [];
75-
76-
return _resolveModuleNames(
77-
moduleNames.filter((moduleName) => {
78-
if (isRelativeCSS(moduleName)) {
79-
resolvedCSS.push({
80-
extension: ts_module.Extension.Dts,
81-
resolvedFileName: path.resolve(
82-
path.dirname(containingFile),
83-
moduleName,
84-
),
85-
});
86-
return false;
87-
}
88-
return true;
89-
}),
74+
const resolvedModules: ts_module.ResolvedModuleFull[] = _resolveModuleNames(
75+
moduleNames,
9076
containingFile,
9177
reusedNames,
92-
).concat(resolvedCSS);
78+
);
79+
80+
return moduleNames.map((moduleName, index) => {
81+
if (isRelativeCSS(moduleName)) {
82+
return {
83+
extension: ts_module.Extension.Dts,
84+
isExternalLibraryImport: false,
85+
resolvedFileName: path.resolve(
86+
path.dirname(containingFile),
87+
moduleName,
88+
),
89+
};
90+
}
91+
return resolvedModules[index];
92+
});
9393
};
9494
}
9595

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"declaration": true,
4-
// "forceConsistentCasingInFileNames": true,
4+
"forceConsistentCasingInFileNames": true,
55
"lib": ["esnext"],
66
"module": "commonjs",
77
"moduleResolution": "node",

0 commit comments

Comments
 (0)