Files
twenty_crm/packages/twenty-eslint-plugin/src/tests/styled-components-prefixed-with-styled.spec.ts
Charles Bochet 44baaee28e Update scripts and documentation to use nx and new monorepo architecture (#2912)
* Update scripts and documentation to use nx and new monorepo architecture

* Start fixing docker

* Migrate eslint plugin and postgres setup

* Fix docker

* Fix patches

* Fix

* fix: wip try to fix the patches

* Apply patches

---------

Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
2023-12-11 10:54:57 +01:00

48 lines
999 B
TypeScript

import { RuleTester } from "@typescript-eslint/rule-tester";
import styledComponentsPrefixedWithStyledRule from "../rules/styled-components-prefixed-with-styled";
const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaFeatures: {
jsx: true,
},
},
});
ruleTester.run(
"styled-components-prefixed-with-styled",
styledComponentsPrefixedWithStyledRule,
{
valid: [
{
code: "const StyledButton = styled.button``;",
},
{
code: "const StyledComponent = styled.div``;",
},
],
invalid: [
{
code: "const Button = styled.button``;",
errors: [
{
messageId: "noStyledPrefix",
},
],
},
{
code: "const Component = styled.div``;",
errors: [
{
messageId: "noStyledPrefix",
},
],
},
],
},
);