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 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;'])