mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
linting and formatting for everything
This commit is contained in:
parent
f7a5177f6f
commit
6af53e4ec5
@ -8,8 +8,8 @@
|
||||
"no-bare-urls": false,
|
||||
"first-line-h1": false,
|
||||
"first-heading-h1": false,
|
||||
"blanks-around-fences": false,
|
||||
"no-trailing-punctuation": false,
|
||||
"ol-prefix": false,
|
||||
"ul-style": { "style": "dash" }
|
||||
"ul-style": { "style": "dash" },
|
||||
"blanks-around-fences": false
|
||||
}
|
||||
|
3
.prettierignore
Normal file
3
.prettierignore
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
public
|
||||
.cache
|
46
README.md
46
README.md
@ -26,6 +26,7 @@
|
||||
- [Repositories](#repositories)
|
||||
- [Development](#development)
|
||||
- [Use Docker](#use-docker)
|
||||
- [Linting & formatting](#linting--formatting)
|
||||
- [GitHub GraphQL API](#github-graphql-api)
|
||||
- [Authors](#authors)
|
||||
- [License](#license)
|
||||
@ -126,8 +127,8 @@ Additionally, you can attach multiple links to a repo. The GitHub link is automa
|
||||
```yaml
|
||||
- name: keeper-contracts
|
||||
links:
|
||||
- name: Documentation
|
||||
url: https://github.com/oceanprotocol/keeper-contracts/tree/develop/doc
|
||||
- name: Documentation
|
||||
url: https://github.com/oceanprotocol/keeper-contracts/tree/develop/doc
|
||||
```
|
||||
|
||||
in [`/data/repositories.yml`](data/repositories.yml).
|
||||
@ -175,6 +176,25 @@ docker-compose up
|
||||
|
||||
This will expose a hot-reloading server under [localhost:8000](http://localhost:8000).
|
||||
|
||||
## Linting & formatting
|
||||
|
||||
To enforce a consistent code style, linting is setup for pretty much every file. Linting is part of the test suite, meaning builds on Travis will fail in case of linting errors.
|
||||
|
||||
In this repo the following tools are setup for that:
|
||||
|
||||
- ESLint with [eslint-config-oceanprotocol]https://github.com/oceanprotocol/eslint-config-oceanprotocol
|
||||
- Stylelint with [stylelint-config-bigchaindb]https://github.com/bigchaindb/stylelint-config-bigchaindb
|
||||
- [markdownlint](https://github.com/DavidAnson/markdownlint)
|
||||
- [Prettier](https://prettier.io)
|
||||
|
||||
```bash
|
||||
# only run linting checks
|
||||
npm run lint
|
||||
|
||||
# auto-formatting of all js, css, md, yml files
|
||||
npm run format
|
||||
```
|
||||
|
||||
## GitHub GraphQL API
|
||||
|
||||
The GitHub GraphQL API integration is done through [gatsby-source-graphql](https://www.gatsbyjs.org/packages/gatsby-source-graphql/) and requires authorization.
|
||||
@ -197,19 +217,19 @@ This query should get you started to explore what information you can get from G
|
||||
|
||||
```graphql
|
||||
query {
|
||||
github {
|
||||
organization(login: "oceanprotocol") {
|
||||
repositories(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
description
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
github {
|
||||
organization(login: "oceanprotocol") {
|
||||
repositories(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
description
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
32
package.json
32
package.json
@ -3,6 +3,23 @@
|
||||
"description": "One site to rule all docs",
|
||||
"version": "0.0.1",
|
||||
"author": "Ocean Protocol <devops@oceanprotocol.com>",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "gatsby build",
|
||||
"start": "gatsby develop",
|
||||
"ssr": "npm run build && serve -s public/",
|
||||
"format:js": "prettier --write '**/*.{js,jsx}'",
|
||||
"format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'",
|
||||
"format:md": "prettier --write '**/*.md'",
|
||||
"format:yml": "prettier --write '**/*.{yml,yaml}'",
|
||||
"format": "run-p format:js format:css format:md format:yml",
|
||||
"lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .js,.jsx .",
|
||||
"lint:css": "stylelint './src/**/*.{css,scss}'",
|
||||
"lint:md": "markdownlint './**/*.{md,markdown}' --ignore node_modules",
|
||||
"lint:yml": "prettier '**/*.{yml,yaml}' --list-different",
|
||||
"lint": "run-p --continue-on-error lint:js lint:css lint:md lint:yml",
|
||||
"test": "npm run lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/art": "^1.0.2",
|
||||
"classnames": "^2.2.6",
|
||||
@ -39,21 +56,6 @@
|
||||
"react-helmet": "^5.2.0",
|
||||
"rehype-react": "^3.0.3"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "gatsby build",
|
||||
"start": "gatsby develop",
|
||||
"ssr": "npm run build && serve -s public/",
|
||||
"format:js": "prettier --write 'src/**/*.{js,jsx}'",
|
||||
"format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'",
|
||||
"format:md": "prettier --write './content/**/*.md' --no-semi",
|
||||
"format": "run-p format:js format:css",
|
||||
"lint:js": "eslint ./gatsby-*.js && eslint ./src/**/*.{js,jsx}",
|
||||
"lint:css": "stylelint ./src/**/*.{css,scss}",
|
||||
"lint:md": "markdownlint './content/**/*.md'",
|
||||
"lint": "run-p lint:js lint:css",
|
||||
"test": "npm run lint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@svgr/webpack": "^4.0.2",
|
||||
"dotenv": "^6.1.0",
|
||||
|
Loading…
Reference in New Issue
Block a user