prettier/tests_integration/__tests__/__snapshots__/with-config-precedence.js.snap

260 lines
6.7 KiB
Plaintext
Raw Normal View History

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CLI --stdin-filepath works with --config-precedence cli-override (stdout) 1`] = `
"let x: keyof Y = foo<typeof X>()
"
`;
exports[`CLI --stdin-filepath works with --config-precedence cli-override (write) 1`] = `Array []`;
exports[`CLI --stdin-filepath works with --config-precedence file-override (stdout) 1`] = `
"let x: keyof Y = foo<typeof X>();
"
`;
exports[`CLI --stdin-filepath works with --config-precedence file-override (write) 1`] = `Array []`;
exports[`CLI --stdin-filepath works with --config-precedence prefer-file (stdout) 1`] = `
"let x: keyof Y = foo<typeof X>();
"
`;
exports[`CLI --stdin-filepath works with --config-precedence prefer-file (write) 1`] = `Array []`;
exports[`CLI overrides are still applied when no config is found with --config-precedence file-override (stderr) 1`] = `""`;
exports[`CLI overrides are still applied when no config is found with --config-precedence file-override (stdout) 1`] = `
"function noConfigJs() {
console.log(\\"no-config/file.js should have no semicolons\\")
}
"
`;
exports[`CLI overrides are still applied when no config is found with --config-precedence file-override (write) 1`] = `Array []`;
exports[`CLI overrides gets applied when no config exists with --config-precedence prefer-file (stderr) 1`] = `""`;
exports[`CLI overrides gets applied when no config exists with --config-precedence prefer-file (stdout) 1`] = `
"function noConfigJs() {
console.log(
\\"no-config/file.js should have no semicolons\\"
);
}
"
`;
exports[`CLI overrides gets applied when no config exists with --config-precedence prefer-file (write) 1`] = `Array []`;
exports[`CLI overrides gets ignored when config exists with --config-precedence prefer-file (stderr) 1`] = `""`;
exports[`CLI overrides gets ignored when config exists with --config-precedence prefer-file (stdout) 1`] = `
"function js() {
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\");
}
\\"use strict\\";
module.exports = {
tabWidth: 8
};
"
`;
exports[`CLI overrides gets ignored when config exists with --config-precedence prefer-file (write) 1`] = `Array []`;
exports[`CLI overrides take lower precedence with --config-precedence file-override (stderr) 1`] = `""`;
exports[`CLI overrides take lower precedence with --config-precedence file-override (stdout) 1`] = `
"function js() {
console.log(\\"js/file.js should have tab width 8 (1 if CLI)\\");
}
\\"use strict\\";
module.exports = {
tabWidth: 8
};
"
`;
exports[`CLI overrides take lower precedence with --config-precedence file-override (write) 1`] = `Array []`;
exports[`CLI overrides take precedence with --config-precedence cli-override (stderr) 1`] = `""`;
exports[`CLI overrides take precedence with --config-precedence cli-override (stdout) 1`] = `
Re-add EditorConfig support (undo #3213) (#3255) * Revert "Revert "Respect EditorConfig settings" (#3213)" This reverts commit d2241fc0d52d807701d9a5ac580bc01010e7a93b. * Comment out EditorConfig docs See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769 * editorconfig: Support `indent_size = 0` See https://github.com/prettier/prettier/pull/2760#discussion_r137447715 and https://github.com/josephfrazier/editorconfig-to-prettier/commit/c38b84c42a2e022067c104c494298a8c9533e7a7 * Revert "Comment out EditorConfig docs" This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f. * Mark EditorConfig functionality as v1.9.0+ See https://github.com/prettier/prettier/pull/3255#discussion_r150432508 * editorconfig: Upgrade editorconfig-to-prettier to 0.0.4 * editorconfig: Only enable for CLI, by default https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add tests confirming that editorconfig is ignored by default in the API https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add/fix CLI option parsing * editorconfig: Move docs from configuration.md to options.md * editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig` Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792 * editorconfig: Update test snapshots * editorconfig: Remove unnecessary options parsing code Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560 * editorconfig: Move docs from options.md to api.md and cli.md Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979 * resolveConfig: return null if both .prettierrc and .editorconfig are missing Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613 * Don't add now-failing tests The way these tests work, both `tests_integration/cli/config/.prettierrc` and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`, so the test wouldn't work even on master. Here's a way to confirm that: ```js const path = require('path') const assert = require('assert') const prettier = require('./') const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist' console.log(prettier.resolveConfig.sync(file)) assert(prettier.resolveConfig.sync(file) === null) ```
2017-12-05 01:28:27 +03:00
"function f() {
console.log(
\\"should have tab width 8\\"
)
}
function f() {
console.log(
\\"should have space width 2\\"
)
}
function f() {
console.log(
\\"should have space width 8\\"
)
}
function f() {
console.log(
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
)
}
Re-add EditorConfig support (undo #3213) (#3255) * Revert "Revert "Respect EditorConfig settings" (#3213)" This reverts commit d2241fc0d52d807701d9a5ac580bc01010e7a93b. * Comment out EditorConfig docs See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769 * editorconfig: Support `indent_size = 0` See https://github.com/prettier/prettier/pull/2760#discussion_r137447715 and https://github.com/josephfrazier/editorconfig-to-prettier/commit/c38b84c42a2e022067c104c494298a8c9533e7a7 * Revert "Comment out EditorConfig docs" This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f. * Mark EditorConfig functionality as v1.9.0+ See https://github.com/prettier/prettier/pull/3255#discussion_r150432508 * editorconfig: Upgrade editorconfig-to-prettier to 0.0.4 * editorconfig: Only enable for CLI, by default https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add tests confirming that editorconfig is ignored by default in the API https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add/fix CLI option parsing * editorconfig: Move docs from configuration.md to options.md * editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig` Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792 * editorconfig: Update test snapshots * editorconfig: Remove unnecessary options parsing code Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560 * editorconfig: Move docs from options.md to api.md and cli.md Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979 * resolveConfig: return null if both .prettierrc and .editorconfig are missing Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613 * Don't add now-failing tests The way these tests work, both `tests_integration/cli/config/.prettierrc` and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`, so the test wouldn't work even on master. Here's a way to confirm that: ```js const path = require('path') const assert = require('assert') const prettier = require('./') const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist' console.log(prettier.resolveConfig.sync(file)) assert(prettier.resolveConfig.sync(file) === null) ```
2017-12-05 01:28:27 +03:00
console.log(
\\"jest/__best-tests__/file.js should have semi\\"
);
console.log(
\\"jest/Component.js should not have semi\\"
)
console.log(
\\"jest/Component.test.js should have semi\\"
);
function js() {
console.log(
\\"js/file.js should have tab width 8 (1 if CLI)\\"
);
}
\\"use strict\\";
module.exports = {
tabWidth: 8
};
function noConfigJs() {
console.log(
\\"no-config/file.js should have no semicolons\\"
)
}
function packageJs() {
console.log(
\\"package/file.js should have tab width 3\\"
);
}
function rcJson() {
console.log.apply(
null,
[
'rc-json/file.js',
'should have trailing comma',
'and single quotes',
],
);
}
function rcYaml() {
console.log.apply(
null,
[
'rc-yaml/file.js',
'should have trailing comma',
'and single quotes',
],
);
}
"
`;
exports[`CLI overrides take precedence with --config-precedence cli-override (write) 1`] = `Array []`;
exports[`CLI overrides take precedence without --config-precedence (stderr) 1`] = `""`;
exports[`CLI overrides take precedence without --config-precedence (stdout) 1`] = `
Re-add EditorConfig support (undo #3213) (#3255) * Revert "Revert "Respect EditorConfig settings" (#3213)" This reverts commit d2241fc0d52d807701d9a5ac580bc01010e7a93b. * Comment out EditorConfig docs See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769 * editorconfig: Support `indent_size = 0` See https://github.com/prettier/prettier/pull/2760#discussion_r137447715 and https://github.com/josephfrazier/editorconfig-to-prettier/commit/c38b84c42a2e022067c104c494298a8c9533e7a7 * Revert "Comment out EditorConfig docs" This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f. * Mark EditorConfig functionality as v1.9.0+ See https://github.com/prettier/prettier/pull/3255#discussion_r150432508 * editorconfig: Upgrade editorconfig-to-prettier to 0.0.4 * editorconfig: Only enable for CLI, by default https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add tests confirming that editorconfig is ignored by default in the API https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add/fix CLI option parsing * editorconfig: Move docs from configuration.md to options.md * editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig` Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792 * editorconfig: Update test snapshots * editorconfig: Remove unnecessary options parsing code Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560 * editorconfig: Move docs from options.md to api.md and cli.md Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979 * resolveConfig: return null if both .prettierrc and .editorconfig are missing Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613 * Don't add now-failing tests The way these tests work, both `tests_integration/cli/config/.prettierrc` and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`, so the test wouldn't work even on master. Here's a way to confirm that: ```js const path = require('path') const assert = require('assert') const prettier = require('./') const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist' console.log(prettier.resolveConfig.sync(file)) assert(prettier.resolveConfig.sync(file) === null) ```
2017-12-05 01:28:27 +03:00
"function f() {
console.log(
\\"should have tab width 8\\"
)
}
function f() {
console.log(
\\"should have space width 2\\"
)
}
function f() {
console.log(
\\"should have space width 8\\"
)
}
function f() {
console.log(
\\"should have space width 2 despite ../.editorconfig specifying 8, because ./.hg is present\\"
)
}
Re-add EditorConfig support (undo #3213) (#3255) * Revert "Revert "Respect EditorConfig settings" (#3213)" This reverts commit d2241fc0d52d807701d9a5ac580bc01010e7a93b. * Comment out EditorConfig docs See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769 * editorconfig: Support `indent_size = 0` See https://github.com/prettier/prettier/pull/2760#discussion_r137447715 and https://github.com/josephfrazier/editorconfig-to-prettier/commit/c38b84c42a2e022067c104c494298a8c9533e7a7 * Revert "Comment out EditorConfig docs" This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f. * Mark EditorConfig functionality as v1.9.0+ See https://github.com/prettier/prettier/pull/3255#discussion_r150432508 * editorconfig: Upgrade editorconfig-to-prettier to 0.0.4 * editorconfig: Only enable for CLI, by default https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add tests confirming that editorconfig is ignored by default in the API https://github.com/prettier/prettier/pull/3255#issuecomment-348420546 * editorconfig: Add/fix CLI option parsing * editorconfig: Move docs from configuration.md to options.md * editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig` Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792 * editorconfig: Update test snapshots * editorconfig: Remove unnecessary options parsing code Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560 * editorconfig: Move docs from options.md to api.md and cli.md Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979 * resolveConfig: return null if both .prettierrc and .editorconfig are missing Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613 * Don't add now-failing tests The way these tests work, both `tests_integration/cli/config/.prettierrc` and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`, so the test wouldn't work even on master. Here's a way to confirm that: ```js const path = require('path') const assert = require('assert') const prettier = require('./') const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist' console.log(prettier.resolveConfig.sync(file)) assert(prettier.resolveConfig.sync(file) === null) ```
2017-12-05 01:28:27 +03:00
console.log(
\\"jest/__best-tests__/file.js should have semi\\"
);
console.log(
\\"jest/Component.js should not have semi\\"
)
console.log(
\\"jest/Component.test.js should have semi\\"
);
function js() {
console.log(
\\"js/file.js should have tab width 8 (1 if CLI)\\"
);
}
\\"use strict\\";
module.exports = {
tabWidth: 8
};
function noConfigJs() {
console.log(
\\"no-config/file.js should have no semicolons\\"
)
}
function packageJs() {
console.log(
\\"package/file.js should have tab width 3\\"
);
}
function rcJson() {
console.log.apply(
null,
[
'rc-json/file.js',
'should have trailing comma',
'and single quotes',
],
);
}
function rcYaml() {
console.log.apply(
null,
[
'rc-yaml/file.js',
'should have trailing comma',
'and single quotes',
],
);
}
"
`;
exports[`CLI overrides take precedence without --config-precedence (write) 1`] = `Array []`;
exports[`CLI validate options with --config-precedence cli-override (stderr) 1`] = `
"[error] Invalid \`\\"printWidth\\"\` value. Expected an integer, but received \`0.5\`.
"
`;
exports[`CLI validate options with --config-precedence cli-override (stdout) 1`] = `""`;
exports[`CLI validate options with --config-precedence cli-override (write) 1`] = `Array []`;
exports[`CLI validate options with --config-precedence file-override (stderr) 1`] = `
"[error] Invalid \`\\"printWidth\\"\` value. Expected an integer, but received \`0.5\`.
"
`;
exports[`CLI validate options with --config-precedence file-override (stdout) 1`] = `""`;
exports[`CLI validate options with --config-precedence file-override (write) 1`] = `Array []`;
exports[`CLI validate options with --config-precedence prefer-file (stderr) 1`] = `
"[error] Invalid \`\\"printWidth\\"\` value. Expected an integer, but received \`0.5\`.
"
`;
exports[`CLI validate options with --config-precedence prefer-file (stdout) 1`] = `""`;
exports[`CLI validate options with --config-precedence prefer-file (write) 1`] = `Array []`;