Skip to content

Commit

Permalink
chore: use flat ESLint config
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Oct 6, 2023
1 parent e8828a2 commit cae4abe
Show file tree
Hide file tree
Showing 12 changed files with 769 additions and 839 deletions.
9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

39 changes: 37 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
{
// Enable the ESLint flat config support
"eslint.experimental.useFlatConfig": true,

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

// Auto-fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
"source.fixAll.eslint": true,
"source.organizeImports": false
},

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

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2021-2023 Johann Schopplich <https://github.com/johannschopplich>
Copyright (c) 2022-2023 Jonas Kuske <https://github.com/jonaskuske>
Copyright (c) 2021-PRESENT Johann Schopplich <https://github.com/johannschopplich>
Copyright (c) 2022-PRESENT Jonas Kuske <https://github.com/jonaskuske>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,6 @@ Disables the default behavior of watching all PHP files for changes.
## License
[MIT](./LICENSE) License © 2021-2023 [Johann Schopplich](https://github.com/johannschopplich)
[MIT](./LICENSE) License © 2021-PRESENT [Johann Schopplich](https://github.com/johannschopplich)
[MIT](./LICENSE) License © 2022-2023 [Jonas Kuske](https://github.com/jonaskuske)
[MIT](./LICENSE) License © 2022-PRESENT [Jonas Kuske](https://github.com/jonaskuske)
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{
ignores: ['examples/**', 'tsconfig.json'],
},
{
rules: {
'node/prefer-global/process': 'off',
},
},
)
3 changes: 3 additions & 0 deletions examples/eslint-and-prettier/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@byjohann/eslint-config"
}
9 changes: 0 additions & 9 deletions examples/eslint-and-prettier/.eslintrc.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions examples/eslint-and-prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"format": "prettier \"src/**/*.{css,js,vue}\" --write"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.2.0",
"eslint": "^8.49.0",
"@byjohann/eslint-config": "^0.2.2",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"kirbyup": "latest",
"prettier": "^3.0.3"
Expand Down
16 changes: 9 additions & 7 deletions examples/eslint-and-prettier/src/components/DemoSection.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<script>
export default {
// Put your section logic here
}
</script>

<template>
<section class="k-demo-section">
<header class="k-section-header">
<h2 class="k-headline">Your custom section</h2>
<h2 class="k-headline">
Your custom section
</h2>
</header>
</section>
</template>

<script>
export default {
// Put your section logic here
};
</script>

<style>
/** Put your CSS here **/
</style>
2 changes: 1 addition & 1 deletion examples/tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": "kirbyup src/index.js"
},
"devDependencies": {
"autoprefixer": "^10.4.15",
"autoprefixer": "^10.4.16",
"kirbyup": "latest",
"tailwindcss": "^3.3.3"
}
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "kirbyup",
"type": "module",
"version": "3.0.1",
"packageManager": "pnpm@8.7.4",
"packageManager": "pnpm@8.8.0",
"description": "Zero-config bundler for Kirby Panel plugins",
"author": {
"name": "Johann Schopplich",
Expand Down Expand Up @@ -75,33 +76,33 @@
"chokidar": "^3.5.3",
"consola": "^3.2.3",
"detect-package-manager": "^3.0.1",
"magic-string": "^0.30.3",
"magic-string": "^0.30.4",
"pathe": "^1.1.1",
"perfect-debounce": "^1.0.0",
"postcss": "^8.4.29",
"postcss": "^8.4.31",
"postcss-dir-pseudo-class": "^8.0.0",
"postcss-load-config": "^4.0.1",
"postcss-logical": "^7.0.0",
"rollup-plugin-external-globals": "^0.8.0",
"sass": "^1.66.1",
"unconfig": "^0.3.10",
"vite": "^4.4.9",
"sass": "^1.69.0",
"unconfig": "^0.3.11",
"vite": "^4.4.11",
"vite-plugin-full-reload": "^1.0.5",
"vue": "^2.7.14"
},
"devDependencies": {
"@antfu/eslint-config": "^0.41.0",
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.17.15",
"@types/prompts": "^2.4.4",
"@antfu/eslint-config": "^1.0.0-beta.21",
"@types/fs-extra": "^11.0.2",
"@types/node": "^20.8.2",
"@types/prompts": "^2.4.5",
"bumpp": "^9.2.0",
"eslint": "^8.49.0",
"eslint": "^8.50.0",
"fast-glob": "^3.3.1",
"fs-extra": "^11.1.1",
"simple-git-hooks": "^2.9.0",
"typescript": "~5.2.2",
"unbuild": "^2.0.0",
"vitest": "^0.34.4"
"vitest": "^0.34.6"
},
"simple-git-hooks": {
"commit-msg": "node scripts/verifyCommit.mjs $1"
Expand Down
Loading

0 comments on commit cae4abe

Please sign in to comment.