-
Notifications
You must be signed in to change notification settings - Fork 920
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
refactor: upgrade eslint and fix lint and type errors #1600
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d255c49
fix: upgrade eslint and fix lint and type errors
meteorlxy f1d5b37
chore: updates
meteorlxy b4679c5
chore: updates
meteorlxy ff32bf3
chore: updates
meteorlxy d85018d
chore: updates
meteorlxy 2d377d2
chore: updates
meteorlxy 4175b6c
chore: updates
meteorlxy 7aa9f43
chore: updates
meteorlxy bae6b36
chore: updates
meteorlxy ddea4de
chore: updates
meteorlxy eb90978
chore: updates
meteorlxy bef1863
chore: fix types
meteorlxy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import { getDirname, path } from 'vuepress/utils' | ||
|
||
const __dirname = getDirname(import.meta.url) | ||
const DIRNAME = getDirname(import.meta.url) | ||
|
||
export const fooPlugin = { | ||
name: 'test-plugin', | ||
clientConfigFile: path.resolve( | ||
__dirname, | ||
'./nonDefaultExportClientConfig.js', | ||
), | ||
clientConfigFile: path.resolve(DIRNAME, './nonDefaultExportClientConfig.js'), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
import type { Page, Theme } from 'vuepress/core' | ||
import type { Theme } from 'vuepress/core' | ||
import { getDirname, path } from 'vuepress/utils' | ||
|
||
const __dirname = getDirname(import.meta.url) | ||
const DIRNAME = getDirname(import.meta.url) | ||
|
||
export const e2eTheme = (): Theme => { | ||
return { | ||
name: '@vuepress/theme-e2e', | ||
export const e2eTheme = (): Theme => ({ | ||
name: '@vuepress/theme-e2e', | ||
|
||
alias: { | ||
// ... | ||
}, | ||
alias: { | ||
// ... | ||
}, | ||
|
||
define: { | ||
// ... | ||
}, | ||
define: { | ||
// ... | ||
}, | ||
|
||
clientConfigFile: path.resolve(__dirname, '../client/config.ts'), | ||
clientConfigFile: path.resolve(DIRNAME, '../client/config.ts'), | ||
|
||
extendsPage: (page: Page) => { | ||
// ... | ||
}, | ||
extendsPage: () => { | ||
// ... | ||
}, | ||
|
||
plugins: [], | ||
} | ||
} | ||
plugins: [], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
declare const str: string | ||
export default str | ||
declare const STR: string | ||
export default STR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { fs, getDirname, path } from 'vuepress/utils' | ||
|
||
const __dirname = getDirname(import.meta.url) | ||
const DIRNAME = getDirname(import.meta.url) | ||
|
||
const resolveSourceMarkdownPath = (...args: string[]): string => | ||
path.resolve(__dirname, '../docs', ...args) | ||
path.resolve(DIRNAME, '../docs', ...args) | ||
|
||
export const readSourceMarkdown = async (filePath: string): Promise<string> => { | ||
return fs.readFile(resolveSourceMarkdownPath(filePath), 'utf-8') | ||
} | ||
export const readSourceMarkdown = async (filePath: string): Promise<string> => | ||
fs.readFile(resolveSourceMarkdownPath(filePath), 'utf-8') | ||
|
||
export const writeSourceMarkdown = async ( | ||
filePath: string, | ||
content: string, | ||
): Promise<void> => { | ||
return fs.writeFile(resolveSourceMarkdownPath(filePath), content) | ||
} | ||
): Promise<void> => fs.writeFile(resolveSourceMarkdownPath(filePath), content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import fs from 'node:fs' | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { vuepress } from 'eslint-config-vuepress' | ||
|
||
const ROOT = path.resolve(fileURLToPath(import.meta.url), '..') | ||
const E2E_DIR = path.resolve(ROOT, 'e2e') | ||
const PACKAGES_DIRS = fs | ||
.readdirSync(path.resolve(ROOT, 'packages')) | ||
.map((item) => `./packages/${item}`) | ||
|
||
export default vuepress( | ||
{ | ||
imports: { | ||
packageDir: [ROOT, E2E_DIR, ...PACKAGES_DIRS], | ||
}, | ||
typescript: { | ||
overrides: { | ||
'@typescript-eslint/no-dynamic-delete': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'no-underscore-dangle': [ | ||
'warn', | ||
{ allow: ['_context', '_pageChunk', '_registeredComponents'] }, | ||
], | ||
}, | ||
}, | ||
vue: { | ||
overrides: { | ||
'no-useless-assignment': 'off', // TODO: false positive in vue sfc | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['**/tests/**'], | ||
rules: { | ||
'import/no-unresolved': 'off', | ||
'no-console': 'off', | ||
'prefer-template': 'off', | ||
}, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, I think the original one is fine, and I have seen other repos doing this.
Are there some rules that disallow this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all fine. Just don't want to add complicated
@typescript-eslint/naming-convention
override 😮💨There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mister-Hope Reverted. It should have been supported in [email protected]