-
-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add snapshot tests for migrate <eslint|prettier> --fix
- Loading branch information
Showing
4 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
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
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
68 changes: 68 additions & 0 deletions
68
crates/biome_cli/tests/snapshots/main_commands_migrate_eslint/migrate_eslintrcjson_fix.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
source: crates/biome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `biome.json` | ||
|
||
```json | ||
{ | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": false, | ||
"complexity": { "noUselessLabel": "error", "useLiteralKeys": "off" }, | ||
"security": { "noGlobalEval": "warn" }, | ||
"style": { "useDefaultParameterLast": "off" }, | ||
"suspicious": { "noDoubleEquals": "warn", "useGetterReturn": "error" } | ||
}, | ||
"ignore": ["**/*.test.js"] | ||
}, | ||
"javascript": { "globals": ["var2", "var1"] }, | ||
"overrides": [ | ||
{ | ||
"ignore": ["*.test.js"], | ||
"include": ["bin/*.js", "lib/*.js"], | ||
"linter": { "rules": { "suspicious": { "noDoubleEquals": "off" } } } | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## `.eslintrc.json` | ||
|
||
```json | ||
{ | ||
"ignorePatterns": [ | ||
"**/*.test.js", // trailing comma amd comment | ||
], | ||
"globals": { | ||
"var1": "writable", | ||
"var2": "readonly" | ||
}, | ||
"rules": { | ||
"dot-notation": 0, | ||
"default-param-last": "off", | ||
"eqeqeq": "warn", | ||
"getter-return": [2, | ||
// support unknown options | ||
{ "allowImplicit": true } | ||
], | ||
"no-eval": 1, | ||
"no-extra-label": ["error"] | ||
}, | ||
"overrides": [{ | ||
"files": ["bin/*.js", "lib/*.js"], | ||
"excludedFiles": "*.test.js", | ||
"rules": { | ||
"eqeqeq": ["off"] | ||
} | ||
}], | ||
"unknownField": "ignored" | ||
} | ||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
.eslintrc.json has been successfully migrated. | ||
``` |
45 changes: 45 additions & 0 deletions
45
crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_fix.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
source: crates/biome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `biome.json` | ||
|
||
```json | ||
{ | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineEnding": "lf", | ||
"lineWidth": 80, | ||
"attributePosition": "auto" | ||
}, | ||
"linter": { "enabled": true }, | ||
"javascript": { | ||
"formatter": { | ||
"jsxQuoteStyle": "double", | ||
"quoteProperties": "asNeeded", | ||
"trailingCommas": "all", | ||
"semicolons": "always", | ||
"arrowParentheses": "always", | ||
"bracketSpacing": true, | ||
"bracketSameLine": false, | ||
"quoteStyle": "single", | ||
"attributePosition": "auto" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## `.prettierrc` | ||
|
||
```prettierrc | ||
{ "useTabs": false, "semi": true, "singleQuote": true } | ||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
.prettierrc has been successfully migrated. | ||
``` |