Skip to content

Commit f9d7f6c

Browse files
43081jfabiospampinato
authored andcommitted
test: migrate stdin-filepath tests
Copies the stdin-filepath tests from prettier. Notable differences: - Blocked by #21 - Syntax errors output the `stdin-filepath` basename in prettier but not in this CLI (e.g. `[Error] foo.js SyntaxError blah`)
1 parent 4b1a66a commit f9d7f6c

13 files changed

Lines changed: 284 additions & 1 deletion

File tree

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"@types/js-yaml": "^4.0.9",
6565
"@types/node": "^22.15.10",
6666
"cross-env": "^7.0.3",
67+
"dedent": "^1.6.0",
6768
"jest": "^30.0.0",
6869
"jest-snapshot-serializer-ansi": "^2.2.1",
6970
"jest-snapshot-serializer-raw": "^2.0.0",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
endOfLine: 'auto'
2+
overrides:
3+
- files: "*.js"
4+
options:
5+
semi: false
6+
- files: "*.ts"
7+
options:
8+
semi: true
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*.js]
4+
indent_style = tab
5+
tab_width = 8
6+
indent_size = 2 # overridden by tab_width since indent_style = tab
7+
max_line_length = 100
8+
9+
# Indentation override for all JS under lib directory
10+
[lib/**.js]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[lib/indent_size=tab.js]
15+
indent_size = tab
16+
17+
[tab_width=unset.js]
18+
tab_width = unset
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function f() {
2+
console.log("should have tab width 8");
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function f() {
2+
console.log("should have space width 2");
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function f() {
2+
console.log("should have space width 8");
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This isn't really a Mercurial repo, but we want to pretend it is for testing purposes.
2+
See https://github.com/prettier/prettier/pull/3559#issuecomment-353857109
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function f() {
2+
console.log("should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present");
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore/

0 commit comments

Comments
 (0)