Skip to content
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

style: add @vkontakte/prettier-config #360

Merged
merged 2 commits into from
Jan 24, 2023
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
41 changes: 12 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const noUnusedVars = [
'error',
{ignoreRestSiblings: true, argsIgnorePattern: '^_.*$'},
];
const noUnusedVars = ['error', { ignoreRestSiblings: true, argsIgnorePattern: '^_.*$' }];

module.exports = {
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -38,38 +35,24 @@ module.exports = {
},
rules: {
'no-unused-vars': noUnusedVars,
'max-lines': [
'error',
{max: 1500, skipBlankLines: true, skipComments: true},
],
'max-lines-per-function': [
'error',
{max: 110, skipBlankLines: true, skipComments: true},
],
'max-lines': ['error', { max: 1500, skipBlankLines: true, skipComments: true }],
'max-lines-per-function': ['error', { max: 110, skipBlankLines: true, skipComments: true }],
'no-console': 'off',
'new-cap': [
'error',
{
capIsNewExceptions: ['Deferred', 'Event'],
},
],
'spaced-comment': [
'error',
'always',
{markers: ['#region'], exceptions: ['#endregion']},
],
'lines-between-class-members': [
'error',
'always',
{exceptAfterSingleLine: true},
],
'spaced-comment': ['error', 'always', { markers: ['#region'], exceptions: ['#endregion'] }],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'no-prototype-builtins': 'off',
'no-throw-literal': 'off',
'prefer-promise-reject-errors': 'off',
'no-shadow': 'off',
'prefer-template': 'error',
'require-await': 'error',
curly: 'error',
'curly': 'error',

'@typescript-eslint/class-name-casing': 'off',
'no-useless-constructor': 'off', // see @typescript-eslint/no-useless-constructor
Expand All @@ -87,9 +70,9 @@ module.exports = {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{selector: 'default', format: ['camelCase']},
{ selector: 'default', format: ['camelCase'] },

{selector: 'variableLike', format: ['camelCase']},
{ selector: 'variableLike', format: ['camelCase'] },
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
Expand All @@ -99,21 +82,21 @@ module.exports = {
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{selector: 'memberLike', format: ['camelCase']},
{ selector: 'memberLike', format: ['camelCase'] },
{
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},

{selector: 'typeLike', format: ['PascalCase']},
{selector: 'typeParameter', format: ['PascalCase']},
{ selector: 'typeLike', format: ['PascalCase'] },
{ selector: 'typeParameter', format: ['PascalCase'] },

{
selector: 'interface',
format: ['PascalCase'],
custom: {regex: '^I[A-Z]', match: false},
custom: { regex: '^I[A-Z]', match: false },
},
],
'@typescript-eslint/interface-name-prefix': 'off',
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# style: add @vkontakte/prettier-config
f756c56311383dfe6f6d32d718fa04c3f63cea7c
13 changes: 7 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Перед отправкой этого реквеста на ревью убедитесь, что:
* в вашей ветке работает сборка (`npm run build:local`),
* в вашей ветке проходят тесты (`npm test`),
* в вашей ветке проходит линтер (`npm run lint`), некоторые ошибки можно автоматически поправить с помощью `npm run lint:fix`,
* покрытие тестов не ниже минимального значения,
* если вы вносите изменения в задокументированные части библиотеки,

- в вашей ветке работает сборка (`npm run build:local`),
- в вашей ветке проходят тесты (`npm test`),
- в вашей ветке проходит линтер (`npm run lint`), некоторые ошибки можно автоматически поправить с помощью `npm run lint:fix`,
- покрытие тестов не ниже минимального значения,
- если вы вносите изменения в задокументированные части библиотеки,
ваш pull request содержит обновления документации,
* если вы вносите изменения в сами токены, вы
- если вы вносите изменения в сами токены, вы
согласовали их с дизайнерами.

[Подробнее о внесении изменений в репозиторий токенов](https://github.com/VKCOM/vkui-tokens/blob/master/CONTRIBUTING.md)
22 changes: 11 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "daily"
interval: 'daily'
allow:
- dependency-type: "direct"
- dependency-type: 'direct'
reviewers:
- "VKCOM/vk-sec"
- "VKCOM/vkui-core"
- package-ecosystem: "github-actions"
- 'VKCOM/vk-sec'
- 'VKCOM/vkui-core'
- package-ecosystem: 'github-actions'
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
directory: '/'
schedule:
interval: "daily"
interval: 'daily'
reviewers:
- "VKCOM/vk-sec"
- "VKCOM/vkui-core"
- 'VKCOM/vk-sec'
- 'VKCOM/vkui-core'
4 changes: 2 additions & 2 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
registry-url: https://registry.npmjs.org/
- run: yarn
- run: npm run publish:latest
if: "!github.event.release.prerelease"
if: '!github.event.release.prerelease'
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_PUBLISH_TOKEN}}
- run: npm run publish:dist
if: "github.event.release.prerelease"
if: 'github.event.release.prerelease'
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_PUBLISH_TOKEN}}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ node_modules/
!/tasks/**/*.js
!.eslintrc.js
!jest.config.js
!.prettierrc.js
.yarnclean
.DS_Store
.idea
Expand Down
9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@vkontakte/prettier-config').createConfig();
Loading