From 89fd16fb0f27dd981bca654be5f78909b9517f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric?= Date: Sat, 21 Aug 2021 15:57:39 +0200 Subject: [PATCH 1/2] Add default .editorconfig to template Same file as https://github.com/facebook/react So just expliciting the _de facto_ default coding standard used --- packages/cra-template/template/.editorconfig | 15 +++++++++++++++ test/integration/create-react-app/index.test.js | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 packages/cra-template/template/.editorconfig diff --git a/packages/cra-template/template/.editorconfig b/packages/cra-template/template/.editorconfig new file mode 100644 index 00000000000..8e4ab961d49 --- /dev/null +++ b/packages/cra-template/template/.editorconfig @@ -0,0 +1,15 @@ +# https://github.com/facebook/react/blob/main/.editorconfig +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +max_line_length = 80 +trim_trailing_whitespace = true + +[*.md] +max_line_length = 0 +trim_trailing_whitespace = false diff --git a/test/integration/create-react-app/index.test.js b/test/integration/create-react-app/index.test.js index 875fd8ca348..cba716dddbc 100644 --- a/test/integration/create-react-app/index.test.js +++ b/test/integration/create-react-app/index.test.js @@ -11,7 +11,13 @@ jest.setTimeout(1000 * 60 * 5); const projectName = 'test-app'; const genPath = join(__dirname, projectName); -const generatedFiles = ['.gitignore', 'package.json', 'src', 'yarn.lock']; +const generatedFiles = [ + '.gitignore', + 'package.json', + 'src', + 'yarn.lock', + '.editorconfig', +]; beforeEach(() => remove(genPath)); afterAll(() => remove(genPath)); From 2d117cfeb76d4a3cc04bc976bfb9f5a2b2561a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric?= Date: Thu, 9 Sep 2021 18:50:25 +0200 Subject: [PATCH 2/2] @ninezero90hy 2021-09-09 review --- packages/cra-template/template/.editorconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/cra-template/template/.editorconfig b/packages/cra-template/template/.editorconfig index 8e4ab961d49..be61ce6ae19 100644 --- a/packages/cra-template/template/.editorconfig +++ b/packages/cra-template/template/.editorconfig @@ -7,9 +7,8 @@ end_of_line = lf indent_size = 2 indent_style = space insert_final_newline = true -max_line_length = 80 trim_trailing_whitespace = true [*.md] -max_line_length = 0 +insert_final_newline = false trim_trailing_whitespace = false