Skip to content

Commit

Permalink
🚨 max-attributes-per-line single 3 #43
Browse files Browse the repository at this point in the history
  • Loading branch information
trydofor committed Oct 9, 2024
1 parent 30afe5c commit b0395b0
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .changeset/tame-stingrays-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@fessional/razor-common": patch
"@fessional/razor-mobile": patch
---

max-attributes-per-line single 3
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"files.encoding": "utf8bom",
"files.autoGuessEncoding": true,
"cSpell.words": [
"devs",
"dropoff",
"fessional",
"iconify",
Expand Down
11 changes: 2 additions & 9 deletions layers/common/components/DpiImg.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
<template>
<img
:srcset="srcset"
:src="src"
:alt="props.alt"
>
<img :srcset="srcset" :src="src" :alt="props.alt">
</template>

<script lang="ts" setup>
const props = defineProps<{
alt?: string;
srcset: string[];
}>();
const props = defineProps<{ alt?: string; srcset: string[] }>();
const src = props.srcset[0];
const srcset = props.srcset.map((img, idx) => `${img} ${idx + 1}x`).join(', ');
Expand Down
14 changes: 14 additions & 0 deletions layers/common/devs/eslint-vue-common.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @type {import('eslint').Linter.RulesRecord}
*/
export const rules = {
// https://eslint.vuejs.org/rules/max-attributes-per-line.html
'vue/max-attributes-per-line': ['error', { singleline: { max: 3 } }],
};

/**
* @type {import('eslint').Linter.Config}
*/
const config = { files: ['**/*.vue'], rules };

export default config;
5 changes: 5 additions & 0 deletions layers/common/devs/eslint-vue-common.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { Linter } from 'eslint';

export declare const rules: Linter.RulesRecord;
declare const config: Linter.Config;
export default config;
2 changes: 2 additions & 0 deletions layers/common/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// @ts-check
import vueCommon from './devs/eslint-vue-common.mjs';
import withNuxt from './.nuxt/eslint.config.mjs';

// https://eslint.nuxt.com/packages/module
export default withNuxt(
vueCommon,
);
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const ignore = [
* @type {import('eslint').Linter.RulesRecord}
*/
export const rules = {
// https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html
'vue/no-deprecated-slot-attribute': ['error', { ignore }],
};

Expand All @@ -105,5 +106,4 @@ export const rules = {
*/
const config = { files: ['**/*.vue'], rules };

// https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html
export default config;
4 changes: 2 additions & 2 deletions layers/mobile/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
import config from './devs/eslint-ionic-slot.mjs';
import vueIonic from './devs/eslint-vue-ionic.mjs';
import withNuxt from './.nuxt/eslint.config.mjs';

export default withNuxt(
config,
vueIonic,
);

0 comments on commit b0395b0

Please sign in to comment.