Skip to content

Commit

Permalink
adjusting linting settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle committed Jun 26, 2024
1 parent 1a0fa51 commit 29afed6
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 96 deletions.
6 changes: 4 additions & 2 deletions apps/vue-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"build": "storybook build -c .storybook -o storybook_compiled",
"percy": "percy storybook http://localhost:6006",
"percy:dry-run": "percy storybook http://localhost:6006 --dry-run",
"lint": "eslint ./stories",
"lint:fix": "eslint ./stories --fix",
"lint:app": "eslint './.storybook/**/*.@(js|ts)'",
"lint:app:fix": "eslint './.storybook/**/*.@(js|ts)' --fix",
"lint": "eslint './../../packages/vue/src/**/*.stories.@(js|ts|mdx)' && pnpm lint:app",
"lint:fix": "eslint './../../packages/vue/src/**/*.stories.@(js|ts|mdx)' --fix && pnpm lint:app:fix",
"init-msw": "msw init public/"
},
"dependencies": {
Expand Down
35 changes: 12 additions & 23 deletions packages/configs/eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: {}, // Add recommendedConfig property
allConfig: {}, // Add allConfig property
allConfig: {} // Add allConfig property
})

export default [
Expand All @@ -37,29 +37,22 @@ export default [
'**/*.ts',
'**/*.tsx',
'**/*.cts',
'**/*.mts',
],
ignores: [
'**/*.d.ts',
'**/dist/**/*',
'**/dist/**/*',
'**/.nuxt/*',
'**/node_modules/**/*',
'.gitignore',
'**/*.mts'
],
ignores: ['**/*.d.ts', '**/dist/**/*', '**/.nuxt/*', '**/node_modules/**/*', '.gitignore'],
plugins: {
'@typescript-eslint': tsPlugin,
'@stylistic': stylistic,
'@stylistic': stylistic
},
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsParser,
parser: tsParser
},
ecmaVersion: 'latest',
ecmaVersion: 'latest'
},
rules: {
'semi': 'off',
semi: 'off',
'@stylistic/semi': ['warn', 'never'],
// allow async-await
'generator-star-spacing': 'off',
Expand All @@ -69,7 +62,7 @@ export default [
'no-void': 'off',
'multiline-ternary': 'off',
'no-unused-vars': 'warn',

'no-undef': 'warn',

'prefer-promise-reject-errors': 'off',
Expand All @@ -78,11 +71,7 @@ export default [
'vue/multi-word-component-names': 'warn',

// TypeScript
quotes: [
'warn',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
Expand All @@ -98,8 +87,8 @@ export default [
'storybook/prefer-pascal-case': 'off',
'storybook/story-exports': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/max-attributes-per-line': 'off',
},
'vue/max-attributes-per-line': 'off'
}
},
eslintPluginPrettierRecommended,
eslintPluginPrettierRecommended
]
3 changes: 2 additions & 1 deletion packages/configs/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"publishConfig": {
"access": "public"
},
"prettier": "@explorer-1/prettier-config",
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.3.0",
Expand All @@ -21,4 +22,4 @@
"eslint-plugin-vue": "^9.26.0",
"vue-eslint-parser": "^9.4.2"
}
}
}
129 changes: 68 additions & 61 deletions packages/nuxt/playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,87 @@
<div class="relative">
<base-heading size="h1">Nuxt Module Playground</base-heading>
<div class="text-center mb-3">
<base-button variant="primary">
Button component
</base-button>
<base-button variant="primary"> Button component </base-button>
</div>
<block-image class="relative" :data="BlockImageData" />
<block-image
class="relative"
:data="BlockImageData"
/>
<p>This is a paragraph, not a component.</p>
<hero-media :image="{
url: 'https://picsum.photos/1440/620',
width: 1440,
height: 620
}" />
<detail-headline title="NASA's Ingenuity Mars Helicopter Recharges Its Batteries in Flight" publication-date="2020-08-13" :topics="[
{
title: 'Mars',
url: '/topics/mars'
},
{
title: 'Rover',
url: '/topics/rover'
}
]" />
<hero-media
:image="{
url: 'https://picsum.photos/1440/620',
width: 1440,
height: 620
}"
/>
<detail-headline
title="NASA's Ingenuity Mars Helicopter Recharges Its Batteries in Flight"
publication-date="2020-08-13"
:topics="[
{
title: 'Mars',
url: '/topics/mars'
},
{
title: 'Rover',
url: '/topics/rover'
}
]"
/>
<mission-detail-highlights
:animation="true"
heading="Heading"
mission-title="UAD"
:highlights="[
{
date: '1983-01-21',
heading: 'Launch',
highlightLink: {
externalLink: null,
page: {
title: 'Color Picture from Spirit is Most Detailed View of Mars Ever Seen',
url: '/news/from-russia-with-grace/'
}
},
summary: 'A successful launch happened.'
},
{
date: '1983-06-08',
heading: null,
highlightLink: {
externalLink: null,
page: {
title: 'Color Picture from Spirit is Most Detailed View of Mars Ever Seen',
url: '/news/from-russia-with-grace/'
{
date: '1983-01-21',
heading: 'Launch',
highlightLink: {
externalLink: null,
page: {
title: 'Color Picture from Spirit is Most Detailed View of Mars Ever Seen',
url: '/news/from-russia-with-grace/'
}
},
summary: 'A successful launch happened.'
},
{
date: '1983-06-08',
heading: null,
highlightLink: {
externalLink: null,
page: {
title: 'Color Picture from Spirit is Most Detailed View of Mars Ever Seen',
url: '/news/from-russia-with-grace/'
}
},
summary: null
},
{
date: '1983-11-21',
heading: 'End of mission',
highlightLink: {
externalLink: 'https://www.nasa.gov',
page: null
},
summary:
'Following a 10-month-long mission, the space telescope exhausts its cryogen and ceases operations.'
}
},
summary: null
},
{
date: '1983-11-21',
heading: 'End of mission',
highlightLink: {
externalLink: 'https://www.nasa.gov',
page: null
},
summary:
'Following a 10-month-long mission, the space telescope exhausts its cryogen and ceases operations.'
}
]"
]"
/>
<block-cta
:data="{
heading: 'Call to action',
text: 'CTA',
page: '',
externalLink: 'http://www.jpl.nasa.gov'
}"
/>
<block-cta :data="{
heading: 'Call to action',
text: 'CTA',
page: '',
externalLink: 'http://www.jpl.nasa.gov'
}" />

</div>
</template>

<script setup>
const BlockImageData = {
blockType: 'FullBleedImageBlock',
fullBleed: false,
Expand Down
3 changes: 3 additions & 0 deletions packages/nuxt/playground/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import withNuxt from './.nuxt/eslint.config.mjs'
import config from '@explorer-1/eslint-config'
export default withNuxt().prepend(config)
2 changes: 1 addition & 1 deletion packages/nuxt/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default defineNuxtConfig({
modules: ['../src/module'],
modules: ['@nuxt/eslint', '../src/module'],
explorer1: {},
devtools: { enabled: true }
})
9 changes: 8 additions & 1 deletion packages/nuxt/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
"private": true,
"name": "my-module-playground",
"type": "module",
"prettier": "@explorer-1/prettier-config",
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"generate": "nuxi generate"
"generate": "nuxi generate",
"lint": "eslint",
"lint:fix": "eslint --fix"
},
"dependencies": {
"nuxt": "^3.11.2"
},
"devDependencies": {
"@nuxt/eslint": "^0.3.13",
"@explorer-1/eslint-config": "workspace:*"
}
}
37 changes: 30 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 29afed6

Please sign in to comment.