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

🛠️ [Eslint] Switch to flat config #84

Merged
merged 45 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
91ab665
:arrow_up: [Node] Bump node and pnpm versions
beefchimi May 30, 2024
6000dbf
:truck: [Eslint] Rename root config file
beefchimi May 30, 2024
d896ef6
:toolbox: [Dependency] Revise package.json files and reinstall
beefchimi May 30, 2024
7308da9
:hammer_and_wrench: [TsConfig] Include new eslint config file in root…
beefchimi May 30, 2024
fcb6680
:hammer_and_wrench: [VsCode] Add flat config support
beefchimi May 30, 2024
70dd401
:fire: [Types] Remove redundant types that now come from beeftools
beefchimi May 30, 2024
438a08a
:truck: [Eslint] Rename app config
beefchimi May 30, 2024
aae649e
:toolbox: [Dependency] Uninstall rushstack package
beefchimi May 30, 2024
89fa417
:toolbox: [Dependency] Try adding @eslint/eslintrc to app packages
beefchimi May 30, 2024
05a4c48
:hammer_and_wrench: [Eslint] Try configuring root eslint
beefchimi May 30, 2024
056fd41
:hammer_and_wrench: [Eslint] Adjust root config
beefchimi May 30, 2024
7041125
:hammer_and_wrench: [Eslint] Attempt to get website linting working
beefchimi May 30, 2024
abf10a6
:books: [Docs] Include Mutable AI Wiki badge
beefchimi Jun 7, 2024
7d3fe83
:alembic: [Eslint] More config experiments
beefchimi Jul 15, 2024
cc91335
:arrow_up: [Node] Bump again
beefchimi Jul 29, 2024
c63a5d6
:adhesive_bandage: [Temp] Temporary markdown file
beefchimi Jul 30, 2024
7710513
:alembic: [Antfu] Attempt to switch to new eslint config
beefchimi Jul 30, 2024
d6b7bb3
:hammer_and_wrench: [Eslint] Tweaks to antfu config
beefchimi Jul 30, 2024
7aba2b7
:art: [Format] All markdown files
beefchimi Jul 30, 2024
3681f25
:art: [Format] All yaml files
beefchimi Jul 30, 2024
a56fb97
:art: [Format] All json files
beefchimi Jul 30, 2024
100fc11
:art: [Format] All config folder files
beefchimi Jul 30, 2024
4416235
:art: [Format] All vite config files
beefchimi Jul 30, 2024
f4250c1
:art: [Format] All mock folder files
beefchimi Jul 30, 2024
7155d74
:art: [Format] All helpers folder files
beefchimi Jul 30, 2024
141b510
:art: [Format] All earwurm folder files
beefchimi Jul 30, 2024
83f2555
:hammer_and_wrench: [Eslint] Setup websites folder for antfu
beefchimi Jul 30, 2024
d7997cd
:art: [Format] Some ts/js files within websites
beefchimi Jul 30, 2024
d6da2ca
:art: [Format] Some various websites files
beefchimi Jul 30, 2024
d2408de
:art: [Format] Websites components folder
beefchimi Jul 30, 2024
2e63e0a
:art: [Format] Websites helpers folder
beefchimi Jul 30, 2024
a60f556
:art: [Format] Websites hooks folder
beefchimi Jul 30, 2024
7fb2a10
:art: [Format] Websites primitives folder
beefchimi Jul 30, 2024
f2ab59b
:art: [Format] Websites sections folder
beefchimi Jul 31, 2024
d3b293e
:art: [Format] Websites store folder
beefchimi Jul 31, 2024
539e961
:hammer_and_wrench: [Eslint] Tweaks for root config
beefchimi Jul 31, 2024
6013297
:alembic: [Temp] Updates to the notes markdown
beefchimi Jul 31, 2024
d97b68e
:toolbox: [Dependency] Regenerate lock file
beefchimi Jul 31, 2024
4e32ff6
:books: [Docs] Minor change to contributing.md
beefchimi Jul 31, 2024
c1a21c7
:fire: [Temp] Remove temporary notes file
beefchimi Jul 31, 2024
a51844c
:hammer_and_wrench: [CI] Fix failed lint workflow due to no build
beefchimi Jul 31, 2024
5204f6f
:rewind: [Vite] Restore propsDestructure feature
beefchimi Jul 31, 2024
fe71468
:memo: [Report] Add changeset
beefchimi Jul 31, 2024
2e647ff
:fire: [VsCode] No longer need to include experiment flatConfig flag
beefchimi Jul 31, 2024
667b837
:fire: [Code] Resolve some instances of ts/return-await
beefchimi Jul 31, 2024
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: 6 additions & 0 deletions .changeset/small-seahorses-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"website": minor
"earwurm": minor
---

Bumped required node and pnpm versions. Also overhauled linting/formatting.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

46 changes: 22 additions & 24 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
🧰 Dependency:
- changed-files:
- any-glob-to-any-file: 'pnpm-lock.yaml'
- any-glob-to-any-file: pnpm-lock.yaml

📚 Documentation:
- changed-files:
- any-glob-to-any-file: ['README.md', 'docs/**']
- any-glob-to-any-file: [README.md, 'docs/**']

⚖️ Legal:
- changed-files:
- any-glob-to-any-file: 'LICENSE'
- any-glob-to-any-file: LICENSE

🔖 Release:
- changed-files:
- any-glob-to-any-file: 'CHANGELOG.md'
- any-glob-to-any-file: CHANGELOG.md

🧪 Testing:
- changed-files:
Expand All @@ -21,23 +21,21 @@
🛠️ Tooling:
- changed-files:
- any-glob-to-any-file:
[
'.github/**',
'.vscode/**',
'.editorconfig',
'.eslintignore',
'.eslintrc',
'.eslintrc.cjs',
'.gitignore',
'.npmignore',
'.nvmrc',
'.prettierignore',
'.prettierrc',
'config/**',
'package.json',
'tsconfig.json',
'tsconfig.*.json',
'vite.config.ts',
'**/*/env.d.ts',
'**/*/lightningcss-plugins.ts',
]
- '.github/**'
- '.vscode/**'
- .editorconfig
- .eslintignore
- .eslintrc
- .eslintrc.cjs
- .gitignore
- .npmignore
- .nvmrc
- .prettierignore
- .prettierrc
- 'config/**'
- package.json
- tsconfig.json
- 'tsconfig.*.json'
- vite.config.ts
- '**/*/env.d.ts'
- '**/*/lightningcss-plugins.ts'
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

# Allow one concurrent deployment.
concurrency:
group: 'pages'
group: pages
cancel-in-progress: true

# This workflow is adapted from:
Expand All @@ -37,8 +37,8 @@ jobs:
- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: .nvmrc
cache: pnpm

- name: 📦 Install dependencies
run: pnpm i
Expand All @@ -52,7 +52,7 @@ jobs:
- name: 📈 Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './app/website/dist'
path: ./app/website/dist

- name: 📱 Deploy to GitHub Pages
id: deployment
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: .nvmrc
cache: pnpm

- name: 📦 Install dependencies
run: pnpm i
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: .nvmrc
cache: pnpm

- name: 📦 Install dependencies
run: pnpm i
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: 🔧 Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: .nvmrc
cache: pnpm

- name: 📦 Install dependencies
run: pnpm i
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12
22.4
5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

6 changes: 3 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"vue.volar",
"csstools.postcss",
"stylelint.vscode-stylelint"
]
"csstools.postcss"
],
"unwantedRecommendations": []
}
60 changes: 57 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",

/*
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["javascript", "typescript", "vue"],
"stylelint.enable": true,
*/

"eslint.useFlatConfig": true,
"typescript.tsdk": "./node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"files.exclude": {
Expand All @@ -17,5 +21,55 @@
"**/node_modules": true,
"lib": true,
"dist/": true
}
},

// Ant-fu
// https://github.com/antfu/eslint-config

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silence the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off", "fixable": true },
{ "rule": "format/*", "severity": "off", "fixable": true },
{ "rule": "*-indent", "severity": "off", "fixable": true },
{ "rule": "*-spacing", "severity": "off", "fixable": true },
{ "rule": "*-spaces", "severity": "off", "fixable": true },
{ "rule": "*-order", "severity": "off", "fixable": true },
{ "rule": "*-dangle", "severity": "off", "fixable": true },
{ "rule": "*-newline", "severity": "off", "fixable": true },
{ "rule": "*quotes", "severity": "off", "fixable": true },
{ "rule": "*semi", "severity": "off", "fixable": true }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"astro",
"css",
"scss",
"pcss",
"postcss"
]
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Earwurm

[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
[![Mutable.ai Auto Wiki](https://img.shields.io/badge/Auto_Wiki-Mutable.ai-blue)](https://wiki.mutable.ai/beefchimi/earwurm)

> `Earwurm` is a minimal-scope library for managing `webm` audio files using the [`Web Audio API`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API).

Expand All @@ -25,6 +26,8 @@ pnpm add earwurm

**Initializing a global instance:**

<!-- eslint-skip -->

```ts
import {Earwurm, type ManagerConfig} from 'earwurm';

Expand Down
19 changes: 1 addition & 18 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,4 @@ All marketing and demo apps are located in this folder.

## Eslint

At the moment, we are allowing each `app` to manage their own `eslint` config. We may later decide to move this to the root level `.eslintrc`. If so, we should be able to clearly specify `Vue` config like so:

```json
"overrides": [
{
"files": "*.vue",
"parser": "vue-eslint-parser",
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript",
"@vue/eslint-config-prettier/skip-formatting",
],
"plugins": [],
"rules": {}
}
],
```
At the moment, we are linting/formatting the entire monorepo from the root `eslint.config.mjs`. In the future, we may use a dedicated `/websites/eslint.config.mjs`.
34 changes: 0 additions & 34 deletions app/website/.eslintrc.cjs

This file was deleted.

60 changes: 60 additions & 0 deletions app/website/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
# Earwurm app

This repo hosts the website for the `earwurm` project.

## TsConfig

Originally, we isolated the `app` vs `node` configs. This had to be changed however because of the following bug: <https://github.com/antfu/eslint-config/issues/564>

As a result, the following packages were removed:

```json
{
"@tsconfig/node20": "^20.1.4",
"@vue/tsconfig": "^0.5.1"
}
```

### Record keeping

In case we ever restore the original `tsconfig`:

#### tsconfig.app.json

```json
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"compilerOptions": {
"composite": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"]
}
```

#### tsconfig.node.json

```json
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"composite": true,
"module": "esnext",
"moduleResolution": "bundler",
"types": ["node"]
},
"include": ["lightningcss-plugins.ts", "vite.config.ts"]
}
```

#### tsconfig.json

```json
{
"references": [
{ "path": "./tsconfig.node.json" },
{ "path": "./tsconfig.app.json" }
],
"files": []
}
```
Loading
Loading