Skip to content

Commit

Permalink
refactor: 更新代码校验规则
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed May 13, 2023
1 parent cf97cf2 commit 1be577b
Show file tree
Hide file tree
Showing 13 changed files with 876 additions and 365 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.cjs

This file was deleted.

38 changes: 38 additions & 0 deletions apps/publisher-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"turbo",
"prettier",
],

parser: "@typescript-eslint/parser",

overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
// Parse the script in `.svelte` as TypeScript by adding the following configuration.
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],

plugins: ["@typescript-eslint", "prettier"],

rules: {
// Note: you must disable the base rule as it can report incorrect errors
semi: "off",
quotes: "off",
"no-undef": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"turbo/no-undeclared-env-vars": "off",
"prettier/prettier": "error",
},
}
File renamed without changes.
31 changes: 31 additions & 0 deletions apps/publisher-app/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

module.exports = {
semi: false,
singleQuote: false,
printWidth: 120,
plugins: ["prettier-plugin-svelte"]
}
25 changes: 0 additions & 25 deletions apps/publisher-app/desgin.md

This file was deleted.

1 change: 1 addition & 0 deletions apps/publisher-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.0.3",
"@terwer/eslint-config-custom": "latest",
"@tsconfig/svelte": "^4.0.1",
"svelte": "^3.57.0",
"svelte-check": "^2.10.3",
Expand Down
15 changes: 8 additions & 7 deletions apps/publisher-app/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script lang="ts">
import svelteLogo from './assets/svelte.svg'
import viteLogo from '/vite.svg'
import Counter from './lib/Counter.svelte'
import svelteLogo from "./assets/svelte.svg"
import viteLogo from "/vite.svg"
import Counter from "./lib/Counter.svelte"
const a = 4
</script>

<main>
Expand All @@ -20,12 +22,11 @@
</div>

<p>
Check out <a href="https://github.com/sveltejs/kit#readme" target="_blank" rel="noreferrer">SvelteKit</a>, the official Svelte app framework powered by Vite!
Check out <a href="https://github.com/sveltejs/kit#readme" target="_blank" rel="noreferrer">SvelteKit</a>, the
official Svelte app framework powered by Vite!
</p>

<p class="read-the-docs">
Click on the Vite and Svelte logos to learn more
</p>
<p class="read-the-docs">Click on the Vite and Svelte logos to learn more</p>
</main>

<style>
Expand Down
6 changes: 3 additions & 3 deletions apps/publisher-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import './app.css'
import App from './App.svelte'
import "./app.css"
import App from "./App.svelte"

const app = new App({
target: document.getElementById('app'),
target: document.getElementById("app"),
})

export default app
2 changes: 1 addition & 1 deletion apps/publisher-app/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"

export default {
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
Expand Down
4 changes: 2 additions & 2 deletions apps/publisher-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { defineConfig } from "vite"
import { svelte } from "@sveltejs/vite-plugin-svelte"

// https://vitejs.dev/config/
export default defineConfig({
Expand Down
11 changes: 11 additions & 0 deletions plugins/publisher-main/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# platform

# Ignore artifacts:
dist
node_modules

# Ignore all dts files:
*.d.ts

# lib
/pnpm-lock.yaml
File renamed without changes.
Loading

0 comments on commit 1be577b

Please sign in to comment.