mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 22:55:03 +03:00
interface: add eslint and update contrib docs
This commit is contained in:
parent
c570def06a
commit
6536054b91
147
pkg/interface/.eslintrc.json
Normal file
147
pkg/interface/.eslintrc.json
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:react/recommended"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"react": {
|
||||||
|
"version": "^16.5.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parser": "babel-eslint",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 10,
|
||||||
|
"requireConfigFile": false,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"root": true,
|
||||||
|
"rules": {
|
||||||
|
"array-bracket-spacing": ["error", "never"],
|
||||||
|
"arrow-parens": [
|
||||||
|
"error",
|
||||||
|
"as-needed",
|
||||||
|
{
|
||||||
|
"requireForBlockBody": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"arrow-spacing": "error",
|
||||||
|
"block-spacing": ["error", "always"],
|
||||||
|
"brace-style": ["error", "1tbs"],
|
||||||
|
"camelcase": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"properties": "never"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"comma-dangle": ["error", "never"],
|
||||||
|
"eol-last": ["error", "always"],
|
||||||
|
"func-name-matching": "error",
|
||||||
|
"indent": [
|
||||||
|
"off",
|
||||||
|
2,
|
||||||
|
{
|
||||||
|
"ArrayExpression": "off",
|
||||||
|
"SwitchCase": 1,
|
||||||
|
"CallExpression": {
|
||||||
|
"arguments": "off"
|
||||||
|
},
|
||||||
|
"FunctionDeclaration": {
|
||||||
|
"parameters": "off"
|
||||||
|
},
|
||||||
|
"FunctionExpression": {
|
||||||
|
"parameters": "off"
|
||||||
|
},
|
||||||
|
"MemberExpression": "off",
|
||||||
|
"ObjectExpression": "off",
|
||||||
|
"ImportDeclaration": "off"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"handle-callback-err": "off",
|
||||||
|
"linebreak-style": ["error", "unix"],
|
||||||
|
"max-statements-per-line": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"max": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"new-cap": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"newIsCap": true,
|
||||||
|
"capIsNew": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"new-parens": "error",
|
||||||
|
"no-buffer-constructor": "error",
|
||||||
|
"no-console": "off",
|
||||||
|
"no-extra-semi": "off",
|
||||||
|
"no-fallthrough": "off",
|
||||||
|
"no-func-assign": "off",
|
||||||
|
"no-implicit-coercion": "error",
|
||||||
|
"no-multi-assign": "error",
|
||||||
|
"no-multiple-empty-lines": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"max": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-nested-ternary": "error",
|
||||||
|
"no-param-reassign": "off",
|
||||||
|
"no-return-assign": "error",
|
||||||
|
"no-return-await": "off",
|
||||||
|
"no-shadow-restricted-names": "error",
|
||||||
|
"no-tabs": "error",
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"vars": "all",
|
||||||
|
"args": "none",
|
||||||
|
"ignoreRestSiblings": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-use-before-define": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"functions": false,
|
||||||
|
"classes": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-useless-escape": "off",
|
||||||
|
"no-var": "error",
|
||||||
|
"nonblock-statement-body-position": ["error", "below"],
|
||||||
|
"object-curly-spacing": ["error", "always"],
|
||||||
|
"padded-blocks": ["error", "never"],
|
||||||
|
"prefer-arrow-callback": "error",
|
||||||
|
"prefer-const": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"destructuring": "all",
|
||||||
|
"ignoreReadBeforeAssign": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"prefer-template": "off",
|
||||||
|
"quotes": ["error", "single"],
|
||||||
|
"semi": ["error", "always"],
|
||||||
|
"spaced-comment": [
|
||||||
|
"error",
|
||||||
|
"always",
|
||||||
|
{
|
||||||
|
"exceptions": ["!"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"space-before-blocks": "error",
|
||||||
|
"unicode-bom": ["error", "never"],
|
||||||
|
"valid-jsdoc": "error",
|
||||||
|
"wrap-iife": ["error", "inside"],
|
||||||
|
"react/jsx-closing-bracket-location": 1,
|
||||||
|
"react/jsx-tag-spacing": 1,
|
||||||
|
"react/jsx-max-props-per-line": ["error", { "maximum": 1, "when": "multiline" }],
|
||||||
|
"react/prop-types": 0
|
||||||
|
}
|
||||||
|
}
|
@ -36,6 +36,23 @@ Please also ensure your pull request fits our standards for
|
|||||||
[arvo]: /pkg/arvo
|
[arvo]: /pkg/arvo
|
||||||
[interface]:/pkg/interface
|
[interface]:/pkg/interface
|
||||||
|
|
||||||
|
## Linting
|
||||||
|
|
||||||
|
The Urbit interface uses Eslint to lint the JavaScript code. To install the
|
||||||
|
linter and for usage through the command, do the following:
|
||||||
|
```bash
|
||||||
|
$ cd ./pkg/interface
|
||||||
|
$ npm install
|
||||||
|
$ npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
To use the linter, run npm scripts
|
||||||
|
```bash
|
||||||
|
$ npm run lint # lints all files in `interface`
|
||||||
|
$ npm run lint-file ./chat/**/*.js # lints all .js files in `interface/chat`
|
||||||
|
$ npm run lint-file ./chat/src/index.js # lints a single chosen file
|
||||||
|
```
|
||||||
|
|
||||||
### Gall
|
### Gall
|
||||||
|
|
||||||
Presently, Gall documentation is still in [progress][gall], but a good
|
Presently, Gall documentation is still in [progress][gall], but a good
|
||||||
|
1603
pkg/interface/package-lock.json
generated
Normal file
1603
pkg/interface/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
19
pkg/interface/package.json
Normal file
19
pkg/interface/package.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "interface",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-eslint": "^10.1.0",
|
||||||
|
"eslint": "^6.8.0",
|
||||||
|
"eslint-plugin-react": "^7.19.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint ./**/*.js",
|
||||||
|
"lint-file": "eslint",
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user