-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Adamant-im/dev
v1.5.0
- Loading branch information
Showing
53 changed files
with
2,532 additions
and
1,585 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,29 @@ | ||
module.exports = { | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"semi": "warn", // обязательно ; | ||
"semi-spacing": ["error", {"before": false, "after": true}], | ||
"indent": ["error", "tab"], | ||
"space-infix-ops": "error",// отступы вокруг + - * / = и тд | ||
"eqeqeq": "error", // обязательно === и !== (нельзя == и !=) | ||
// "no-eq-null": "error", // обязательно === и !== (нельзя == и !=) но тоько в отношении null | ||
"curly": "error", // проверка шаблонов `${name}` | ||
// "space-before-function-paren": [ // отступ до и после function | ||
// "error", { | ||
// "anonymous": "always", | ||
// "named": "always", | ||
// "asyncArrow": "ignore" | ||
// } | ||
// ], | ||
"key-spacing": ["error", { "mode": "strict" }], // оформление обЪекта | ||
"space-in-parens": ["error", "never"], // запрет отступов ( a,b) | ||
"computed-property-spacing": ["error", "never"], // запрет лишних отступов в выражениях a[ i] | ||
"array-bracket-spacing": ["error", "never"], | ||
"no-multi-spaces": "error", // запрет лишних пробелов var a = 2 | ||
"no-sparse-arrays": "warn", // предупреждение при дырке в массиве | ||
"no-mixed-spaces-and-tabs": "error", // нельзя миксовать табы и пробелы | ||
"keyword-spacing": ["error", { "after": true }], | ||
"comma-spacing": ["error", { "before": false, "after": true }], // отступ после запятой, а перед нельзя | ||
"no-undef":"error", | ||
"array-callback-return": "error" // коллбек методов массива типа arr.map arr.filter должны иметь return в коллбеке | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"Vue":true, | ||
"Symbol":true, | ||
"Promise":true, | ||
}, | ||
"plugins": [] | ||
} | ||
env: { | ||
commonjs: true, | ||
es2021: true, | ||
browser: true, | ||
node: true, | ||
'jest/globals': true, | ||
}, | ||
extends: ['eslint:recommended', 'google'], | ||
plugins: ['jest'], | ||
parserOptions: { | ||
ecmaVersion: 12, | ||
}, | ||
rules: { | ||
'max-len': [ | ||
'error', | ||
{ | ||
code: 200, | ||
ignoreTrailingComments: true, | ||
ignoreUrls: true, | ||
ignoreStrings: true, | ||
ignoreTemplateLiterals: true, | ||
ignoreRegExpLiterals: true, | ||
}, | ||
], | ||
'require-jsdoc': 'off', | ||
'quote-props': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ logs/ | |
.vscode/ | ||
test.js | ||
package-lock.json | ||
.editorconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Contributing Guide | ||
|
||
Before submitting your contribution, please make sure to take a moment and read through the following guidelines: | ||
|
||
- [Pull Request Guidelines](#pull-request-guidelines) | ||
- [Development Setup](#development-setup) | ||
- [Scripts](#scripts) | ||
- [Project Structure](#project-structure) | ||
- [Contributing Tests](#contributing-tests) | ||
|
||
## Pull Request Guidelines | ||
|
||
- The master branch is just a snapshot of the latest stable release. All development should be done in dedicated branches. Do not submit PRs against the master branch. | ||
|
||
- Checkout a topic branch from a base branch, e.g. `master`, and merge back against that branch. | ||
|
||
- If adding a new feature add accompanying test case. | ||
|
||
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging. | ||
|
||
- Make sure tests pass! | ||
|
||
- Commit messages must follow the [commit message convention](./commit-convention.md). Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)). | ||
|
||
- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)). | ||
|
||
## Development Setup | ||
|
||
You will need [Node.js](https://nodejs.org) **version 16+**. | ||
|
||
After cloning the repo, run: | ||
|
||
```bash | ||
$ npm i # install the dependencies of the project | ||
``` | ||
|
||
A high level overview of tools used: | ||
|
||
- [Jest](https://jestjs.io/) for unit testing | ||
- [Prettier](https://prettier.io/) for code formatting | ||
|
||
## Scripts | ||
|
||
### `npm run lint` | ||
|
||
The `lint` script runs linter. | ||
|
||
```bash | ||
# lint files | ||
$ npm run lint | ||
# fix linter errors | ||
$ npm run lint:fix | ||
``` | ||
|
||
### `npm run test` | ||
|
||
The `test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples: | ||
|
||
```bash | ||
# run all tests | ||
$ npm run test | ||
|
||
# run all tests under the runtime-core package | ||
$ npm run test -- runtime-core | ||
|
||
# run tests in a specific file | ||
$ npm run test -- fileName | ||
|
||
# run a specific test in a specific file | ||
$ npm run test -- fileName -t 'test name' | ||
``` | ||
|
||
## Project Structure | ||
|
||
- **`src`**: contains the source code | ||
|
||
- **`api`**: contains group of methods and methods for the API. | ||
|
||
- **`helpers`**: contains utilities shared across the entire codebase. | ||
|
||
- **`tests`**: contains tests for the helpers directory. | ||
|
||
- **`tests`**: contains tests for the src directory. | ||
|
||
## Contributing Tests | ||
|
||
Unit tests are collocated with the code being tested inside directories named `tests`. Consult the [Jest docs](https://jestjs.io/docs/en/using-matchers) and existing test cases for how to write new test specs. Here are some additional guidelines: | ||
|
||
- Use the minimal API needed for a test case. For example, if a test can be written without involving the reactivity system or a component, it should be written so. This limits the test's exposure to changes in unrelated parts and makes it more stable. | ||
|
||
- Only use platform-specific runtimes if the test is asserting platform-specific behavior. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'] | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.