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

chore(deps): update eslint (major) #1248

Merged
merged 2 commits into from
Sep 13, 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
22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/PR-SAP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
working-directory: docs
- run: npm test
working-directory: docs
- run: npm run lint
working-directory: docs
- run: npm run docs:build
working-directory: docs
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ jobs:
- run: npm ci
- run: npm test
- run: npm run docs:build
- run: npm run lint
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run docs:build
env:
GH_BASE: /
Expand Down
8 changes: 4 additions & 4 deletions .vitepress/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import path from 'node:path'
import fs from 'node:fs'

import rulesSidebar from '../tools/cds-lint/sidebar.js'
Expand All @@ -13,7 +12,7 @@ const dynamicItems = (item) => {
/**
* Construct sidebar from markdown
*/
export function sidebar (file = 'menu.md', filter=(_)=>true) {
export function sidebar (file = 'menu.md', filter=()=>true) {
const source = file
const markdown = fs.readFileSync(source,'utf8')
const sidebar = []
Expand All @@ -26,13 +25,13 @@ export function sidebar (file = 'menu.md', filter=(_)=>true) {
let [, text, link ] = /^-\s*\[(.*)\]\((.*)\)/.exec(line) || /^-\s*(.*)/.exec(line) || []
if (text && filter(link)) section.items.push (item = _item({ link, text }))
else {
let [, text, link ] = /^ -\s*\[(.*)\]\((.*)\)/.exec(line) || /^ -\s*(.*)/.exec(line) || []
let [, text, link ] = /^ {2}-\s*\[(.*)\]\((.*)\)/.exec(line) || /^ {2}-\s*(.*)/.exec(line) || []
if (text && filter(link)) {
(item.items ??= []).push (subitem = _item({ link, text }))
item.collapsed = true
}
else {
let [, text, link ] = /^ -\s*\[(.*)\]\((.*)\)/.exec(line) || /^ -\s*(.*)/.exec(line) || []
let [, text, link ] = /^ {4}-\s*\[(.*)\]\((.*)\)/.exec(line) || /^ {4}-\s*(.*)/.exec(line) || []
if (text && filter(link)) {
(subitem.items ??= []).push (_item({ link, text }))
subitem.collapsed = true
Expand Down Expand Up @@ -63,5 +62,6 @@ export function nav4(sidebar) {

if (process.argv[1] === import.meta.url.slice(7)) {
let {inspect} = await import ('node:util')
// eslint-disable-next-line no-console
console.log(inspect(sidebar('menu.md'),{depth:11,colors:true}))
}
2 changes: 1 addition & 1 deletion .vitepress/theme/components/NotFound.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import { useRoute, useData, withBase } from 'vitepress'
import { onMounted, ref } from 'vue'
const { frontmatter, site } = useData()
const { site } = useData()
const route = useRoute()

const base = site.value.base
Expand Down
10 changes: 4 additions & 6 deletions .vitepress/theme/components/NotebookHint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@

<script setup>

import { onMounted, computed, ref } from 'vue'
import { useData, useRoute } from 'vitepress'
import { computed } from 'vue'
import { useData } from 'vitepress'

const { frontmatter, base, page, site } = useData()
const { path } = useRoute()
const { frontmatter, site } = useData()

const supportsNotebook = computed(() => !!frontmatter.value['notebook'])
const isExternal = import.meta.env.VITE_CAPIRE_ENV === 'external'

function linkNotebook($event) {
return typeof localStorage !== 'undefined' ? useNotebook($event) : () => {}
}

function useNotebook(event) {
function getNotebook(event) {
function getNotebook() {
const baseUrl = new URL(window.location);
const urlParams = new URLSearchParams(window.location.search)
const implVariant = urlParams.get('impl-variant')
Expand Down
6 changes: 3 additions & 3 deletions .vitepress/theme/components/implvariants/ImplVariants.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function scrollTo(id) {

function currentCheckState() {
const url = new URL(window.location)
let variant = url.searchParams.get('impl-variant')
if (url.searchParams.has('impl-variant'))
return url.searchParams.get('impl-variant') === 'java'
return localStorage.getItem('impl-variant') === 'java'
Expand Down Expand Up @@ -87,7 +86,8 @@ transition: none !important;

cb()

// @ts-expect-error keep unused declaration, used to force the browser to redraw
// keep unused declaration, used to force the browser to redraw
// eslint-disable-next-line no-unused-vars
const _ = window.getComputedStyle(css).opacity
document.head.removeChild(css)
}
Expand All @@ -100,7 +100,7 @@ watchEffect(() => {
}, 20)
})

function toggleContent(variant, initial) {
function toggleContent(variant) {
const htmlClassList = document.documentElement.classList
knownImplVariants.forEach(v => htmlClassList.remove(v))
htmlClassList.add(variant)
Expand Down
63 changes: 0 additions & 63 deletions assets/concepts/_snippets/cds.cds

This file was deleted.

13 changes: 0 additions & 13 deletions assets/concepts/_snippets/http.groovy

This file was deleted.

37 changes: 0 additions & 37 deletions assets/concepts/_snippets/javascript.js

This file was deleted.

26 changes: 26 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import cds from '@sap/cds/eslint.config.mjs'
import vue from 'eslint-plugin-vue'

export default [
{
ignores: [
'**/.vitepress/dist/**',
'**/.vitepress/cache/**',
'**/.github/**'
],
},
...cds.recommended,
...vue.configs['flat/essential'],
{
files: ['*.vue', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: '@typescript-eslint/parser'
},
},
rules: {
'vue/multi-word-component-names': 0,
'vue/no-v-text-v-html-on-component': 0
}
}
]
23 changes: 0 additions & 23 deletions guides/assets/actions-functions/requests.http

This file was deleted.

12 changes: 0 additions & 12 deletions guides/assets/actions-functions/services.cds

This file was deleted.

37 changes: 0 additions & 37 deletions guides/assets/actions-functions/services.js

This file was deleted.

Loading