Skip to content

add ringcentral plugin #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,56 @@ Do not leave console calls in your code

> Reason: it just a noise for other developers. We always can find anything using history of version control system.

### Specify `TODO` | `FIXME` comment with task id or username

> Reason: to not keep not evident and forgotten comments please specify a comment with a task id which is connected with a problem. If it's a light problem and you are going to solve it soon you can provide just your username.
<details>
<summary>Read more</summary>

---

TODO is a useful tool for developers.
There are a few cases when TODO comments could be added:

* the developer is working on the task, and he noticed that part of his work is temporarily blocked (say, his particular task depends on API that not yet ready)
* the developer is working on the task and noticed that he would like to make one/few little improvements later in the scope of this task. However, the task is already done and could be sent for code-review to the boost a process.
* the developer detects some issue in the code and unable to fix it in the scope of his task, but he would like to improve the situation.

**Do not leave anonymous TODO without the id**. Usually, anonymous TODO's live too long while it not linked to the issue tracking system.
Signed TODO's increases the factor of responsibility. When the developer signs TODO it like a short-term note for the author. But, it also a flag that author is responsible to resolve it ASAP. Finally, it makes such part of code clear for reviewers.

---

</details>


```javascript

class UserService {
// BAD
getAllUsers() {
// TODO implement when backend is ready
}

// GOOD
getAllUsers() {
// TODO [UIA-12345] implement when backend is ready
}

// GOOD (if you know that you will do it no later than two weeks)
getAllUsers() {
// TODO (trump.wang) implement when backend is ready
}

// GOOD (to add FIXME if you see some problem code)
badMethod() {
// FIXME [UIA-12345] rewrite this to a better structure
// ...bad code
}
}

```

## Spaces and alignments

### Do not exceed 120 column width
Expand Down Expand Up @@ -469,7 +519,6 @@ let foo = {
```

### Set one space before function body curly bracket ```{```, do not set space after function name

```javascript
// BAD
function isFooBar () {
Expand Down
4 changes: 2 additions & 2 deletions eslint-config-ringcentral/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = {
es6: true,
mocha: true
},
extends: 'eslint:recommended',
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
Expand All @@ -16,7 +15,8 @@ module.exports = {
},
sourceType: 'module'
},
plugins: ['react', 'import'],
plugins: ['react', 'import', 'ringcentral'],
extends: ['eslint:recommended', 'plugin:ringcentral/all'],
globals: {
chai: true,
expect: true,
Expand Down
11 changes: 9 additions & 2 deletions eslint-config-ringcentral/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-ringcentral",
"version": "0.3.1",
"version": "0.4.0",
"description": "ESLint config for the RingCentral style guide",
"main": "index.js",
"scripts": {
Expand All @@ -26,9 +26,16 @@
"url": "https://github.com/ringcentral/ringcentral-javascript/issues"
},
"homepage": "https://github.com/ringcentral/ringcentral-javascript",
"devDependencies": {
"eslint": ">=4.1.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-react": "^7.1.0",
"eslint-plugin-ringcentral": "~1.0.5"
},
"peerDependencies": {
"eslint": ">=4.1.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-react": "^7.1.0"
"eslint-plugin-react": "^7.1.0",
"eslint-plugin-ringcentral": "~1.0.5"
}
}