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: migrate to Eslint flag config #141

Merged
merged 12 commits into from
May 8, 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
36 changes: 0 additions & 36 deletions .eslintrc

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ node_modules
.vscode-test/
*.vsix

ui/node_modules
ui/.env

.DS_Store

TODOs.md
Expand Down
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"typescript.tsc.autoDetect": "off",
"editor.formatOnSave": true
"typescript.tsc.autoDetect": "off",
"editor.formatOnSave": true,
"eslint.experimental.useFlatConfig": true
}
23 changes: 2 additions & 21 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,9 @@

.vscode-test/**
src/**
.gitignore
.yarnrc
!src/sideBar/build/**
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/eslint.config.mjs
**/*.map
**/*.ts


# Ignore all webview-ui files except the build directory
ui/src/**
ui/public/**
ui/scripts/**
ui/index.html
ui/README.md
ui/package.json
ui/package-lock.json
ui/node_modules/**
ui/.env
ui/tsconfig.node.json
ui/tailwind.config.cjs
ui/postcss.config.cjs
ui/.gitignore
ui/.vscode
ui/.prettierrc
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ As part of our roadmap we're exploring the options of building separate extensio

## Repo

Nuxtr VSCode contains a typical [VSCode extension structure](https://code.visualstudio.com/api/get-started/extension-anatomy) with [./ui ](./ui) directory that contains the sidebar UI logic.
Nuxtr VSCode contains a typical [VSCode extension structure](https://code.visualstudio.com/api/get-started/extension-anatomy) with [sidebar](./src/sideBar/) logic written using Vue 3 + TypeScript project and imported using [WebViews](https://code.visualstudio.com/api/extension-guides/webview).

We're using PNPM, so make sure you have it installed. Here's a [quick guide](https://pnpm.io/installation) on how to install it.

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<br />

<div align="center">
<img src=".github/media/logo.png" alt="Logo" width="80" height="80">
<img src="https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/logo.png" alt="Logo" width="80" height="80">
<h3 align="center">Nuxtr VSCode</h3>
<p align="center">An extension offering commands and tools <br /> to make your experience with Nuxt more pleasant!</p>
<div align="center">
Expand Down Expand Up @@ -79,7 +79,7 @@ Additionally, you can choose to automatically open the newly created file with:
"nuxtr.openItemsAfterCreation": true
```

![Nuxt Project Creation](./.github/media/file_creation.gif)
![Nuxt Project Creation](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/file_creation.gif)

<br>
<br>
Expand All @@ -98,7 +98,7 @@ Additionally, you can choose to automatically open the newly created file with:

<br>

![Nuxt Dependencies](./.github/media/dependencies.gif)
![Nuxt Dependencies](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/dependencies.gif)

<br>
<br>
Expand All @@ -115,7 +115,7 @@ You can enable/disable IntelliSense from the settings:
"nuxtr.intellisense.nuxtignore": true,
```

![IntelliSense](./.github/media/intellisense.gif)
![IntelliSense](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/intellisense.gif)

<br>
<br>
Expand All @@ -127,7 +127,7 @@ The Nuxt CLI, also known as [Nuxi](https://github.com/nuxt/cli), is an essential
While using the CLI directly from your terminal is perfectly viable, Nuxtr's integration enhances your development experience, especially when working with multiple terminals. It introduces a structured approach to your terminal environment, categorizing commands based on their scope. This not only streamlines your workflow but also simplifies the process of adding modules, eliminating the need to recall or search for exact names.


![Nuxi CLI](./.github/media/nuxi.gif)
![Nuxi CLI](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/nuxi.gif)

<br>
<br>
Expand Down Expand Up @@ -170,7 +170,7 @@ Set your default template with these settings:
"nuxtr.vueFiles.layouts.defaultTemplate": "default.layout-template"
```

![File Templates](./.github/media/file_templates.gif)
![File Templates](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/file_templates.gif)

<br>
<br>
Expand Down Expand Up @@ -201,7 +201,7 @@ For monorepo configurations, specify the directory name containing your Nuxt pro

Access main scripts directly from the command palette for swift execution. Should you require a custom command, you can conveniently locate it in the sidebar. With the exception of nuxt dev, all other commands operate in the background, and you can monitor the output in the VSCode output channel.

![Nuxt Scripts](./.github/media/scripts.png)
![Nuxt Scripts](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/scripts.png)

<br>
<br>
Expand All @@ -212,7 +212,7 @@ Access main scripts directly from the command palette for swift execution. Shoul

Nuxtr offers a toggle directly in your VSCode statusbar. Manual toggling from nuxt.config.ts is also detected and state is synced.

![Nuxt Devtools](./.github/media/devtools.gif)
![Nuxt Devtools](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/devtools.gif)

<br>
<br>
Expand All @@ -226,7 +226,7 @@ Search and Install Nuxt modules with a typical searching/filters experience as [

Starting from v0.1.0, you can filter integration types (modules/layers) from the sidebar.

![Nuxt Modules](./.github/media/modules.gif)
![Nuxt Modules](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/modules.gif)

<br>
<br>
Expand All @@ -247,7 +247,7 @@ Same for linters:

More coming soon.

![Nuxt Modules](./.github/media/css_frameworks.gif)
![Nuxt Modules](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/.github/media/css_frameworks.gif)

<br>

Expand All @@ -270,4 +270,4 @@ Nuxtr relies on the following projects/repositories:

### License

[MIT](https://github.com/nuxtrdev/nuxtr-vscode/blob/main/LICENSE) License Β© 2023 with πŸ’š
[MIT](https://raw.githubusercontent.com/nuxtrdev/nuxtr-vscode/main/LICENSE) License Β© 2023 with πŸ’š
33 changes: 33 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import unjs from 'eslint-config-unjs';

export default unjs({
rules: {
'@typescript-eslint/naming-convention': 'off',
"@typescript-eslint/no-duplicate-enum-values": 'off',
'@typescript-eslint/semi': 'off',
'curly': ['error', 'all'],
'eqeqeq': 'warn',
'no-throw-literal': 'warn',
'semi': 'off',
'@typescript-eslint/indent': ['error', 4],
'no-multiple-empty-lines': 'warn',
'no-empty': 'warn',
'unicorn/filename-case': 'off',
'unicorn/prefer-event-target': 'off',
'unicorn/no-null': 'off',
'unicorn/no-array-for-each': 'off',
'dot-notation': 'error',
'no-lonely-if': 'error',
'no-useless-rename': 'error',
'object-shorthand': 'error',
'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: false }],
'require-await': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
},
ignores: [
'out',
'node_modules',
'*.js',
'src/sideBar/build'
]
});
14 changes: 11 additions & 3 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ const config: KnipConfig = {
workspaces: {
'.': {
entry: 'src/index.ts',
ignoreDependencies: ['taze', 'terser'],
ignoreDependencies: ['taze', 'terser', 'eslint-config-unjs'],
ignoreBinaries: ['vsce'],
ignore: ['taze.config.ts'],
ignore: ['taze.config.ts', 'eslint.config.mjs'],
tsup: { config: 'tsup.config.ts' },
},
'src/sideBar': {
ignoreDependencies: ['ofetch', '@types/vscode-webview', 'prettier', 'prettier-plugin-tailwindcss'],
ignore: ['build/**', 'prettier.config.ts'],
vite: {
"config": [
"vite.config.ts"
]
}
}
},
ignoreWorkspaces: ['ui']
};

export default config;
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Nuxtr",
"description": "An extension for Nuxt offering commands and tools to make your experience more pleasant.",
"version": "0.2.16",
"packageManager": "pnpm@9.0.6",
"packageManager": "pnpm@9.1.0",
"engines": {
"vscode": "^1.85.0"
},
Expand Down Expand Up @@ -560,7 +560,7 @@
"default": "setup",
"enum": [
"setup",
"normal"
"options"
],
"description": "Script tag type in Vue files template"
},
Expand Down Expand Up @@ -1087,11 +1087,11 @@
"http"
],
"scripts": {
"install:all": "pnpm install && cd ui && pnpm install",
"build": "tsup && cd ui && pnpm build",
"build": "tsup && cd src/sideBar && pnpm build",
"vscode:prepublish": "pnpm build",
"dev": "pnpm build -- --watch",
"lint": "eslint --cache ./src --ext .ts --fix",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"package": "vsce package --no-dependencies",
"publish:release": "vsce publish --no-dependencies",
"publish:pre": "vsce publish --pre-release --no-dependencies",
Expand All @@ -1104,11 +1104,9 @@
"@types/fs-extra": "^11.0.4",
"@types/node": "20.4.1",
"@types/vscode": "^1.85.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"eslint-plugin-oxlint": "^0.1.0",
"eslint-config-unjs": "^0.3.1",
"knip": "^3.13.2",
"nuxi-nightly": "3.11.2-1712838256.8df35eb",
"taze": "^0.11.4",
Expand All @@ -1126,17 +1124,17 @@
"ofetch": "^1.3.4",
"pathe": "^1.1.2",
"pkg-types": "^1.1.0",
"semver": "^7.6.0",
"semver": "^7.6.1",
"string-ts": "^1.3.3"
},
"pnpm": {
"overrides": {
"ip@=2.0.0": ">=2.0.1",
"js-yaml@<2.0.5": ">=4.1.0",
"js-yaml@<3.13.0": ">=4.1.0",
"js-yaml@<3.13.1": ">=4.1.0",
"uglify-js@<2.4.24": ">=3.17.4",
"uglify-js@<2.6.0": ">=3.17.4",
"ip@=2.0.0": ">=2.0.1"
"uglify-js@<2.6.0": ">=3.17.4"
}
}
}
Loading