Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes eslinting rules for storybook #439

Merged
merged 2 commits into from
May 25, 2024
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
6 changes: 3 additions & 3 deletions apps/vue-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"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": "eslint ./stories",
"lint:fix": "eslint ./stories --fix",
"init-msw": "msw init public/"
},
"dependencies": {
Expand All @@ -35,7 +35,7 @@
"@vue/eslint-config-prettier": "^7.1.0",
"@whitespace/storybook-addon-html": "^6.1.1",
"autoprefixer": "^10.4.19",
"msw": "^1.2.1",
"msw": "^2.3.0",
"msw-storybook-addon": "^2.0.2",
"postcss": "^8.4.38",
"rimraf": "^5.0.5",
Expand Down
7 changes: 0 additions & 7 deletions packages/common-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
"name": "@explorer-1/common-storybook",
"version": "0.0.0",
"private": true,
"scripts": {
"lint": "eslint src",
"lint:fix": "eslint src --fix"
},
"prettier": "@explorer-1/prettier-config",
"devDependencies": {
"@explorer-1/common": "workspace:*",
"@explorer-1/prettier-config": "workspace:*",
"@explorer-1/tsconfig": "workspace:*",
"@rushstack/eslint-patch": "^1.2.0",
"@storybook/blocks": "^8.1.2",
"eslint": "^8.34.0",
"eslint-plugin-storybook": "^0.8.0",
"rimraf": "^5.0.5",
"storybook": "^8.1.2",
"ts-node": "^10.9.2",
Expand Down
4 changes: 0 additions & 4 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"name": "@explorer-1/common",
"version": "1.0.0",
"description": "shared assets for all flavors of explorer-1",
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix"
},
"author": "",
"prettier": "@explorer-1/prettier-config",
"devDependencies": {
Expand Down
9 changes: 7 additions & 2 deletions packages/configs/eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const compat = new FlatCompat({

export default [
js.configs.recommended,
...compat.extends('plugin:storybook/recommended'),
...compat.extends('plugin:vue/vue3-recommended'),
...compat.extends('plugin:storybook/recommended'),
{
files: [
'**/*.vue',
Expand Down Expand Up @@ -59,6 +59,7 @@ export default [
ecmaVersion: 'latest',
},
rules: {
'semi': 'off',
'@stylistic/semi': ['warn', 'never'],
// allow async-await
'generator-star-spacing': 'off',
Expand All @@ -68,6 +69,7 @@ export default [
'no-void': 'off',
'multiline-ternary': 'off',
'no-unused-vars': 'warn',

'no-undef': 'warn',

'prefer-promise-reject-errors': 'off',
Expand All @@ -87,11 +89,14 @@ export default [
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'storybook/hierarchy-separator': 'warn',
'storybook/hierarchy-separator': 'off',
'storybook/prefer-pascal-case': 'off',
'storybook/story-exports': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/max-attributes-per-line': 'off',
},
Expand Down
2 changes: 2 additions & 0 deletions packages/configs/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"@stylistic/eslint-plugin": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-vue": "^9.26.0",
"vue-eslint-parser": "^9.4.2"
}
}
4 changes: 2 additions & 2 deletions packages/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"build:fontcss": "cp ./../common/src/scss/_fonts.scss ./dist/assets/css/font-face.css",
"fetch-www": "if ! git clone --depth 1 [email protected]:nasa-jpl/www-frontend.git .www-frontend_temp; then echo 'Updating temp copy of www-frontend' && cd .www-frontend_temp && git pull; fi",
"preview": "vite preview",
"lint": "eslint",
"lint:fix": "eslint --fix"
"lint": "eslint ./src",
"lint:fix": "eslint ./src --fix"
},
"prettier": "@explorer-1/prettier-config",
"browserslist": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Default = AppBarInternalTemplate.bind({})
Default.storyName = 'AppBar'
Default.args = AppBarInternalTemplate.stories.Default.args

const AppBarInternalStoryMeta = {
export const AppBarInternalStoryMeta = {
stories: {
Default: {
storyName: 'AppBar',
Expand Down
1 change: 1 addition & 0 deletions packages/html/src/components/BaseButton/BaseButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const BaseButtonTemplate = ({
if (cssClass) computedClass += ' ' + cssClass
if (iconOnly) {
computedClass += ' -icon-only'
// eslint-disable-next-line no-self-assign
ariaLabel ? (ariaLabel = ariaLabel) : (ariaLabel = label)
label = ''
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const MixinCarouselTemplate = ({

// create centerClass based on center boolean
let centerClass = 'mx-auto'
if (!!center) centerClass = 'mx-auto'
if (center) centerClass = 'mx-auto'
else if (center === false) centerClass = ''

// default rendering of slides if items are provided.
Expand Down
1 change: 1 addition & 0 deletions packages/html/src/docs/utils/ComponentItem.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable prettier/prettier */
/* Custom react component for rendering TOC of components
* docs: https://storybook.js.org/docs/react/writing-docs/docs-page#custom-inline-rendering
*/
Expand Down
1 change: 1 addition & 0 deletions packages/html/src/docs/utils/ComponentList.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable prettier/prettier */
/* Custom react component for rendering TOC of components
* docs: https://storybook.js.org/docs/react/writing-docs/docs-page#custom-inline-rendering
*/
Expand Down
5 changes: 2 additions & 3 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint": "eslint ./src",
"lint:fix": "eslint ./src --fix",
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
},
"prettier": "@explorer-1/prettier-config",
Expand All @@ -39,7 +39,6 @@
"@explorer-1/prettier-config": "workspace:*",
"@explorer-1/vue": "workspace:*",
"@nuxt/devtools": "^1.2.0",
"@nuxt/eslint-config": "^0.3.10",
"@nuxt/module-builder": "^0.6.0",
"@nuxt/schema": "^3.11.2",
"@nuxt/test-utils": "^3.12.1",
Expand Down
7 changes: 2 additions & 5 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"dev": "npm run prepare && vite",
"build": "npm run prepare && vue-tsc && vite build",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint": "eslint ./src",
"lint:fix": "eslint ./src --fix",
"preview": "vite preview",
"prepare": "npm run prepare:fonts",
"prepare:fonts": "cp -R ./node_modules/@explorer-1/common/src/fonts/ ./src/assets/fonts/"
Expand All @@ -24,11 +24,8 @@
"devDependencies": {
"@explorer-1/common": "workspace:*",
"@explorer-1/prettier-config": "workspace:*",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"@vitejs/plugin-vue": "^5.0.4",
"autoprefixer": "^10.4.19",
"eslint-plugin-prettier-vue": "^5.0.0",
"postcss": "^8.4.38",
"typescript": "^5.2.2",
"vite": "^5.2.11",
Expand Down
Loading