Skip to content

Commit 7dd24fb

Browse files
committed
Use CSSTree to parse CSS syntax
1 parent 6efe925 commit 7dd24fb

32 files changed

+518
-889
lines changed

.flowconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[ignore]
2-
.*/node_modules
2+
.*/node_modules/.*
33
.*/__fixtures__/.*
44

55
[include]

.vscode/launch.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"configurations": [
3+
{
4+
"type": "node",
5+
"name": "vscode-jest-tests",
6+
"request": "launch",
7+
"console": "integratedTerminal",
8+
"internalConsoleOptions": "neverOpen",
9+
"disableOptimisticBPs": true,
10+
"cwd": "${workspaceFolder}",
11+
"runtimeExecutable": "npm",
12+
"args": ["run", "test", "--", "--runInBand", "--watchAll=false"]
13+
}
14+
]
15+
}

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"eslint.alwaysShowStatus": true,
77
"eslint.validate": ["javascript", "javascriptreact", "html", "typescript", "typescriptreact"],
88
"files.eol": "\n",
9-
"typescript.tsdk": "node_modules/typescript/lib"
9+
"typescript.tsdk": "node_modules/typescript/lib",
10+
"jest.jestCommandLine": "npm run test --"
1011
}

__tests__/__fixtures__/.flowconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[ignore]
2+
.*/node_modules/.*
23

34
[include]
45
../../index.js.flow

__tests__/__fixtures__/package-lock.json

+75-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

__tests__/__fixtures__/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "csstype-fixtures",
33
"private": true,
44
"dependencies": {
5-
"csstype": "^2.6.18"
5+
"csstype": "file:../..",
6+
"oldcsstype": "npm:csstype@^2.6.18"
67
}
78
}

__tests__/__fixtures__/typecheck.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as CSS from '../..';
22

33
// Old CSSType import needs to be AFTER the current one
4-
import * as OldCSS from 'csstype';
4+
import * as OldCSS from 'oldcsstype';
55

66
const css: CSS.Properties = {
77
flexGrow: 1,

__tests__/__snapshots__/dist.typescript-3.5.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports[`Typescript 3.5 detects errors 4`] = `
2121
`;
2222

2323
exports[`Typescript 3.5 detects errors 5`] = `
24-
"59:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'.
24+
"59:10 - Type 'Range' is not assignable to type '\\"auto\\"'.
2525
Type 'string & {}' is not assignable to type '\\"auto\\"'."
2626
`;
2727

__tests__/__snapshots__/dist.typescript-3.6.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports[`Typescript 3.6 detects errors 4`] = `
2121
`;
2222

2323
exports[`Typescript 3.6 detects errors 5`] = `
24-
"59:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'.
24+
"59:10 - Type 'Range' is not assignable to type '\\"auto\\"'.
2525
Type 'string & {}' is not assignable to type '\\"auto\\"'."
2626
`;
2727

__tests__/__snapshots__/dist.typescript-3.7.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports[`Typescript 3.7 detects errors 4`] = `
2121
`;
2222

2323
exports[`Typescript 3.7 detects errors 5`] = `
24-
"59:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'.
24+
"59:10 - Type 'Range' is not assignable to type '\\"auto\\"'.
2525
Type 'string & {}' is not assignable to type '\\"auto\\"'."
2626
`;
2727

__tests__/__snapshots__/dist.typescript-3.8.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports[`Typescript 3.8 detects errors 4`] = `
1515
`;
1616

1717
exports[`Typescript 3.8 detects errors 5`] = `
18-
"59:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'.
18+
"59:10 - Type 'Range' is not assignable to type '\\"auto\\"'.
1919
Type 'string & {}' is not assignable to type '\\"auto\\"'."
2020
`;
2121

__tests__/__snapshots__/dist.typescript-3.9.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports[`Typescript 3.9 detects errors 4`] = `
1515
`;
1616

1717
exports[`Typescript 3.9 detects errors 5`] = `
18-
"59:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'.
18+
"59:10 - Type 'Range' is not assignable to type '\\"auto\\"'.
1919
Type 'string & {}' is not assignable to type '\\"auto\\"'."
2020
`;
2121

__tests__/__snapshots__/dist.typescript-4.0.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports[`Typescript 4.0 detects errors 4`] = `
1515
`;
1616

1717
exports[`Typescript 4.0 detects errors 5`] = `
18-
"59:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'.
18+
"59:10 - Type 'Range' is not assignable to type '\\"auto\\"'.
1919
Type 'string & {}' is not assignable to type '\\"auto\\"'."
2020
`;
2121

__tests__/__snapshots__/dist.typescript-4.1.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports[`Typescript 4.1 detects errors 4`] = `
1515
`;
1616

1717
exports[`Typescript 4.1 detects errors 5`] = `
18-
"59:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'.
18+
"59:10 - Type 'Range' is not assignable to type '\\"auto\\"'.
1919
Type 'string & {}' is not assignable to type '\\"auto\\"'."
2020
`;
2121

__tests__/package-lock.json

+72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

__tests__/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "csstype-test",
33
"private": true,
44
"dependencies": {
5+
"csstype": "file:..",
56
"typescript3.5": "npm:typescript@~3.5.0",
67
"typescript3.6": "npm:typescript@~3.6.0",
78
"typescript3.7": "npm:typescript@~3.7.0",

0 commit comments

Comments
 (0)