Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
cache: 'pnpm'
cache: "pnpm"
registry-url: "https://registry.npmjs.org"

- name: Update npm
Expand Down
51 changes: 40 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,49 @@ on:
pull_request:

jobs:
biome:
name: Biome
oxlint:
name: oxlint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
cache: "pnpm"

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Install dependencies
run: pnpm install

- name: Run oxlint
run: pnpm oxlint

oxfmt:
name: oxfmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Run Biome
run: biome ci .
- name: Run oxfmt
run: pnpm oxfmt:check

test:
name: Vitest
Expand All @@ -37,7 +66,7 @@ jobs:
uses: actions/setup-node@v6
with:
node-version: "24"
cache: 'pnpm'
cache: "pnpm"

- name: Install dependencies
run: pnpm install
Expand Down
66 changes: 0 additions & 66 deletions .github/workflows/update-biome-schema.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"useTabs": true,
"singleQuote": false
}
7 changes: 7 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": {
"correctness": "error"
},
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import"]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ This repository is a monorepo for ESLint and Stylelint rules for Shopware.

## License

[MIT](./LICENSE)
[MIT](./LICENSE)
46 changes: 0 additions & 46 deletions biome.json

This file was deleted.

16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"packageManager": "pnpm@10.28.1",
"scripts": {
"oxlint": "oxlint .",
"oxlint:fix": "oxlint --fix .",
"oxfmt": "oxfmt .",
"oxfmt:check": "oxfmt --check"
},
"devDependencies": {
"@biomejs/biome": "~2.3.11"
"oxfmt": "^0.33.0",
"oxlint": "^1.48.0"
},
"scripts": {
"biome": "biome",
"biome:fix": "biome format --write . && biome lint --fix --unsafe . && biome check --fix --unsafe .",
"biome:check": "biome ci ."
}
"packageManager": "pnpm@10.28.1"
}
34 changes: 10 additions & 24 deletions packages/admin-eslint-rules/6.7/require-explict-emits.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ export default {
if (isComponentDefinition(objectNode)) {
componentNode = objectNode;
emitsNode = objectNode.properties.find(
(property) =>
property.key?.name === "emits" &&
property.value.type === "ArrayExpression",
(property) => property.key?.name === "emits" && property.value.type === "ArrayExpression",
)?.value;
}
}
Expand All @@ -70,15 +68,10 @@ export default {
function getEmitCallsFromTemplate(importNode) {
if (importNode.name === "template") {
const templateFileName = importNode.parent.parent.source.value;
const directoryPath = dirname(context.getFilename());
const templateSource = readFileSync(
resolve(directoryPath, templateFileName),
"utf8",
);

const templateEventsNames = Array.from(
templateSource.matchAll(EVENT_NAME_REGEXP),
)
const directoryPath = dirname(context.filename);
const templateSource = readFileSync(resolve(directoryPath, templateFileName), "utf8");

const templateEventsNames = Array.from(templateSource.matchAll(EVENT_NAME_REGEXP))
.map(([, capturedGroup]) => capturedGroup)
.filter(Boolean);

Expand Down Expand Up @@ -145,8 +138,7 @@ export default {
}

function fixMissingEmitDefinitions(programNode) {
const emitsDefinition =
emitsNode?.elements.map((element) => element.value) ?? [];
const emitsDefinition = emitsNode?.elements.map((element) => element.value) ?? [];
const pendingEmitDefinitions = Array.from(emittedEvents).filter(
(e) => e && !emitsDefinition.includes(e),
);
Expand All @@ -170,10 +162,7 @@ export default {
// emits with already some event in the component
const lastElement = emitsNode.elements.at(-1);
if (lastElement) {
return fixer.insertTextAfter(
lastElement,
`, ${stringEmitEvents}`,
);
return fixer.insertTextAfter(lastElement, `, ${stringEmitEvents}`);
}

// emits without any event in
Expand Down Expand Up @@ -201,15 +190,12 @@ export default {
"provide",
];

const nodeAfterWhichToInsert = componentNode.properties.findLast(
(property) => fieldsBeforeEmits.includes(property.key.name),
const nodeAfterWhichToInsert = componentNode.properties.findLast((property) =>
fieldsBeforeEmits.includes(property.key.name),
);

if (nodeAfterWhichToInsert) {
return fixer.insertTextAfter(
nodeAfterWhichToInsert,
`,\n\nemits: [${stringEmitEvents}]`,
);
return fixer.insertTextAfter(nodeAfterWhichToInsert, `,\n\nemits: [${stringEmitEvents}]`);
}

// in the case there is no fields that should be before emits, then we insert at the beginning of the component
Expand Down
Loading