Skip to content

Commit

Permalink
DE-157: Feature - Prepare repo for analytics and new components (#481)
Browse files Browse the repository at this point in the history
* add env to git ignore

* add es lint and prettier

* combine prettier and eslint

* fix lint errors

* remove uneeded packa attributes

* only lint source

* remove env from eslint

* lint gh action

* lint gh action v2

* rename gh lint action

* update lint action and engines

* update node version
  • Loading branch information
dannythedawger authored Nov 4, 2022
1 parent 6597b3b commit 11351ab
Show file tree
Hide file tree
Showing 11 changed files with 1,084 additions and 114 deletions.
40 changes: 40 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:prettier/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"overrides": [],
"plugins": [
"prettier",
"@typescript-eslint"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
// Allows for the parsing of JSX
"jsx": true
}
},
"ignorePatterns": [
"node_modules",
"coverage",
"build",
"dist",
".DS_Store",
".env.local",
".env.development.local",
".env.test.local",
".env.production.local",
".vscode/",
"package-lock.json",
"yarn.lock",
"docusaurus.config.js"
],
"rules": {
"prettier/prettier": "error"
}
}
23 changes: 23 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint

on: push

jobs:
lint:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Run linters
run: yarn lint
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ i18n/*
artifacts/
cache/
typechain/

.env

npm-debug.log*
yarn-debug.log*
yarn-error.log*

package-lock.json
23 changes: 22 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"serve": "docusaurus serve",
"clear": "docusaurus clear"
"clear": "docusaurus clear",
"lint": "yarn eslint src"
},
"dependencies": {
"@algolia/autocomplete-preset-algolia": "^1.1.0",
Expand Down Expand Up @@ -45,5 +46,25 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.1.0",
"@tsconfig/docusaurus": "^1.0.6",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "8.5.0",
"eslint-config-standard-with-typescript": "^23.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "^6.0.0",
"prettier": "2.7.1",
"typescript": "^4.8.4"
},
"engines": {
"npm": "please-use-yarn",
"node": "14",
"yarn": ">=1.22"
}
}
64 changes: 0 additions & 64 deletions src/components/HomepageFeatures.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/HomepageFeatures.module.css

This file was deleted.

1 change: 0 additions & 1 deletion src/pages/index.js → src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import Layout from '@theme/Layout'
import Link from '@docusaurus/Link'
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'

import './styles.module.css'
import styled from '@emotion/styled'
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/theme/NavbarItem.js → src/theme/NavbarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useLocation } from '@docusaurus/router'
export default function NavbarItem(props) {
const { pathname } = useLocation()

let versionDoc = pathname.split('/')
let activeNav = null
const versionDoc = pathname.split('/')
let activeNav: null | string = null

if (versionDoc[2] === 'V2' || versionDoc[2] === '2.0.0') {
activeNav = 'V2'
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"baseUrl": "."
}
}
Loading

1 comment on commit 11351ab

@vercel
Copy link

@vercel vercel bot commented on 11351ab Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./

docs-uniswap.vercel.app
docs-git-main-uniswap.vercel.app
docs.uniswap.org

Please sign in to comment.