Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
[eslint] Enforce semis
Alexis Sellier committed 4 years ago
commit 618d49e201da773390fa5ce42ad9903dc9dc2ceb
parent 964e69a86737212697aef56d6a2a5f6c161a4421
10 files changed +31 -17
modified .eslintrc.js
@@ -23,8 +23,22 @@ module.exports = {
    }
  ],
  rules: {
+
    indent: ["error", 2, { "SwitchCase": 1 }],
+
    semi: "off", // We use the typescript-specific rule as it's more accurate.
    "@typescript-eslint/no-explicit-any": "off",
-
    indent: ["error", 2, { "SwitchCase": 1 }]
+
    "@typescript-eslint/semi": ["error"],
+
    "@typescript-eslint/member-delimiter-style": [
+
      "warn", {
+
        "multiline": {
+
          "delimiter": "semi",
+
          "requireLast": true,
+
        },
+
        "singleline": {
+
          "delimiter": "semi",
+
          "requireLast": false,
+
        }
+
      }
+
    ]
  },
  settings: {
    "svelte3/typescript": true,
modified src/Form.svelte
@@ -1,10 +1,10 @@
<script context="module" lang="typescript">
  export interface Field {
-
    name: string
-
    value: string | null
-
    label?: string
-
    placeholder?: string
-
    editable: boolean
+
    name: string;
+
    value: string | null;
+
    label?: string;
+
    placeholder?: string;
+
    editable: boolean;
  }
</script>

modified src/Options.svelte
@@ -1,7 +1,7 @@
<script lang="typescript">
  import { createEventDispatcher } from 'svelte';

-
  export let options: { label: string, value: string }[];
+
  export let options: { label: string; value: string }[];
  export let name: string;
  export let selected = "";
  export let disabled = false;
modified src/base/orgs/Org.ts
@@ -29,8 +29,8 @@ const GetOrgs = `
`;

export class Org {
-
  address: string
-
  owner: string
+
  address: string;
+
  owner: string;

  constructor(address: string, owner: string) {
    assert(ethers.utils.isAddress(address), "address must be valid");
modified src/base/projects/Widget.svelte
@@ -11,7 +11,7 @@
  type State =
      { status: Status.Loading }
    | { status: Status.Loaded }
-
    | { status: Status.Error, error: string };
+
    | { status: Status.Error; error: string };

  export let project: proj.Project;
  export let config: Config;
modified src/base/registrations/Submit.svelte
@@ -19,7 +19,7 @@
  let error: Error | null = null;
  let registrationOwner = owner || session.address;

-
  const view = () => navigate(`/registrations/${subdomain}`)
+
  const view = () => navigate(`/registrations/${subdomain}`);

  onMount(async () => {
    try {
modified src/base/registrations/Update.svelte
@@ -18,7 +18,7 @@
      { status: Status.Signing }
    | { status: Status.Pending }
    | { status: Status.Success }
-
    | { status: Status.Failed, error: string };
+
    | { status: Status.Failed; error: string };

  export let subdomain: string;
  export let config: Config;
modified src/base/registrations/View.svelte
@@ -27,8 +27,8 @@
  type State =
      { status: Status.Loading }
    | { status: Status.NotFound }
-
    | { status: Status.Found, registration: Registration }
-
    | { status: Status.Failed, error: string };
+
    | { status: Status.Found; registration: Registration }
+
    | { status: Status.Failed; error: string };

  export let subdomain: string;
  export let config: Config;
@@ -74,7 +74,7 @@
      .filter(r => r.editable && r.value !== null)
      .map(f => {
        assert(f.value !== null);
-
        return { name: f.name, value: f.value }
+
        return { name: f.name, value: f.value };
      });
  };

modified src/config.ts
@@ -26,7 +26,7 @@ export class Config {
  provider: ethers.providers.JsonRpcProvider;
  signer: ethers.Signer & TypedDataSigner | null;
  safe: { api: string | null; viewer: string | null };
-
  abi: { [contract: string]: string[] }
+
  abi: { [contract: string]: string[] };
  seed: { api: string | null };
  tokens: string[];

modified src/project.ts
@@ -101,7 +101,7 @@ export async function getReadme(
}

export function path(
-
  opts: { urn: string, org?: string, commit?: string, path?: string }
+
  opts: { urn: string; org?: string; commit?: string; path?: string }
): string {
  const { urn, org, commit, path } = opts;
  const result = [];