Skip to content

Commit

Permalink
fix: report unknown theme value again
Browse files Browse the repository at this point in the history
  • Loading branch information
sastan committed Mar 22, 2021
1 parent 230b0b5 commit 2ac3f32
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"dependencies": {
"cssbeautify": "^0.3.1",
"esbuild": "^0.9.3",
"fast-json-stable-stringify": "^2.1.0",
"match-sorter": "^6.3.0",
"twind": "^0.16.6",
"typescript": "^4.1.0",
Expand Down
12 changes: 8 additions & 4 deletions src/twind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Logger } from 'typescript-template-language-service-decorator'
import type * as TS from 'typescript/lib/tsserverlibrary'

import cssbeautify from 'cssbeautify'
import stringify from 'fast-json-stable-stringify'

import type {
Context,
Expand Down Expand Up @@ -405,11 +406,14 @@ export class Twind {
}
}

if (!state.reports.length) {
state.tw(rule)
}
state.tw(rule)

return [...state.reports]
// Remove duplicates
return [
...new Map([
...state.reports.map((report): [string, ReportInfo] => [stringify(report), report]),
]).values(),
]
}

get completions(): Completions {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ fast-glob@^3.1.1:
micromatch "^4.0.2"
picomatch "^2.2.1"

fast-json-stable-stringify@^2.0.0:
fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
Expand Down

0 comments on commit 2ac3f32

Please sign in to comment.