From 6ec0bd9f357e66a5c4b4ef30577f0d5455e71aca Mon Sep 17 00:00:00 2001 From: Evan Jacobs Date: Fri, 23 Jun 2023 15:29:05 -0400 Subject: [PATCH 1/2] chore: add failing test --- test/fixtures/redundant-import-usage/.babelrc | 13 +++++++++++++ test/fixtures/redundant-import-usage/code.js | 9 +++++++++ test/fixtures/redundant-import-usage/output.js | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 test/fixtures/redundant-import-usage/.babelrc create mode 100644 test/fixtures/redundant-import-usage/code.js create mode 100644 test/fixtures/redundant-import-usage/output.js diff --git a/test/fixtures/redundant-import-usage/.babelrc b/test/fixtures/redundant-import-usage/.babelrc new file mode 100644 index 0000000..eb51aea --- /dev/null +++ b/test/fixtures/redundant-import-usage/.babelrc @@ -0,0 +1,13 @@ +{ + "plugins": [ + [ + "../../../src", + { + "ssr": false, + "fileName": true, + "transpileTemplateLiterals": true + } + ], + ["@babel/plugin-proposal-class-properties", { "loose": true }] + ] +} diff --git a/test/fixtures/redundant-import-usage/code.js b/test/fixtures/redundant-import-usage/code.js new file mode 100644 index 0000000..7dd54ca --- /dev/null +++ b/test/fixtures/redundant-import-usage/code.js @@ -0,0 +1,9 @@ +import s, { styled } from 'styled-components' + +const DefaultImportButton = s.button` + background: cornflowerblue; +` + +const NamedImportButton = styled.button` + background: cornflowerblue; +` diff --git a/test/fixtures/redundant-import-usage/output.js b/test/fixtures/redundant-import-usage/output.js new file mode 100644 index 0000000..f17ab23 --- /dev/null +++ b/test/fixtures/redundant-import-usage/output.js @@ -0,0 +1,9 @@ +import s, { styled } from 'styled-components' + +const DefaultImportButton = s.button.withConfig({ + displayName: 'code__DefaultImportButton', +})(['background:cornflowerblue;']) + +const NamedImportButton = styled.button.withConfig({ + displayName: 'code__NamedImportButton', +})(['background:cornflowerblue;']) From 0acbf483f48049bbf3a72e62238aac2b84f6e81c Mon Sep 17 00:00:00 2001 From: Evan Jacobs Date: Fri, 23 Jun 2023 15:30:30 -0400 Subject: [PATCH 2/2] chore: test on node 20 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eecd05e..8e86af2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: ["16", "18", "19"] + node: ['16', '18', '20'] steps: - uses: actions/checkout@v3