Skip to content

Commit c844474

Browse files
ci: configure linters flow
1 parent 72d7230 commit c844474

12 files changed

+240
-334
lines changed

.eslintrc

Lines changed: 159 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,166 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"es6": true,
5-
"node": true
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"airbnb-typescript",
9+
"airbnb/hooks",
10+
"plugin:@typescript-eslint/recommended",
11+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
12+
"plugin:css-modules/recommended",
13+
"plugin:prettier/recommended",
14+
"plugin:import/errors",
15+
"plugin:import/warnings",
16+
"plugin:import/typescript"
17+
],
18+
"globals": {
19+
"Atomics": "readonly",
20+
"SharedArrayBuffer": "readonly"
21+
},
22+
"parser": "@typescript-eslint/parser",
23+
"parserOptions": {
24+
"project": ["tsconfig.json"],
25+
"ecmaFeatures": {
26+
"jsx": true
627
},
7-
"extends": [
8-
"airbnb-typescript",
9-
"airbnb/hooks",
10-
"plugin:@typescript-eslint/recommended",
11-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
12-
"plugin:css-modules/recommended",
13-
"plugin:prettier/recommended",
14-
"plugin:import/errors",
15-
"plugin:import/warnings",
16-
"plugin:import/typescript"
17-
],
18-
"globals": {
19-
"Atomics": "readonly",
20-
"SharedArrayBuffer": "readonly"
21-
},
22-
"parser": "@typescript-eslint/parser",
23-
"parserOptions": {
24-
"project": ["tsconfig.json", "tsconfig.eslint.json"],
25-
"ecmaFeatures": {
26-
"jsx": true
27-
},
28-
"ecmaVersion": 2018,
29-
"sourceType": "module"
28+
"ecmaVersion": 2018,
29+
"sourceType": "module"
30+
},
31+
"settings": {
32+
"react": {
33+
"version": "detect"
3034
},
31-
"settings": {
32-
"react": {
33-
"version": "detect"
34-
},
35-
"import/resolver": {
36-
"node": {
37-
"paths": ["."]
38-
}
35+
"import/resolver": {
36+
"node": {
37+
"paths": ["."]
3938
}
40-
},
41-
"plugins": ["react", "@typescript-eslint", "import", "css-modules", "github"],
42-
"rules": {
43-
"jsx-a11y/media-has-caption": "off",
44-
"import/order": [
45-
"error",
46-
{
47-
"newlines-between": "always-and-inside-groups",
48-
"groups": ["builtin", "external", "internal", "parent", "sibling"],
49-
"pathGroups": [
50-
{
51-
"pattern": "react",
52-
"group": "external",
53-
"position": "before"
54-
},
55-
{
56-
"pattern": "**/*.+(svg|png|jpg|jpeg|mp3|mp4|tiff|webp|gif)",
57-
"group": "sibling",
58-
"position": "after"
59-
},
60-
{
61-
"pattern": "./*.scss",
62-
"group": "sibling",
63-
"position": "after"
64-
}
65-
],
66-
"pathGroupsExcludedImportTypes": [],
67-
"alphabetize": {
68-
"order": "asc"
39+
}
40+
},
41+
"plugins": ["react", "@typescript-eslint", "import", "css-modules", "github"],
42+
"rules": {
43+
"jsx-a11y/media-has-caption": "off",
44+
"import/order": [
45+
"error",
46+
{
47+
"newlines-between": "always-and-inside-groups",
48+
"groups": ["builtin", "external", "internal", "parent", "sibling"],
49+
"pathGroups": [
50+
{
51+
"pattern": "react",
52+
"group": "external",
53+
"position": "before"
54+
},
55+
{
56+
"pattern": "**/*.+(svg|png|jpg|jpeg|mp3|mp4|tiff|webp|gif)",
57+
"group": "sibling",
58+
"position": "after"
59+
},
60+
{
61+
"pattern": "./*.scss",
62+
"group": "sibling",
63+
"position": "after"
6964
}
65+
],
66+
"pathGroupsExcludedImportTypes": [],
67+
"alphabetize": {
68+
"order": "asc"
7069
}
71-
],
72-
"no-restricted-imports": [
73-
"error",
74-
{
75-
"paths": [
76-
{
77-
"name": "./",
78-
"message": "Use import from non-index file in the same directory"
79-
},
80-
{
81-
"name": ".",
82-
"message": "Use import from non-index file in the same directory"
83-
}
84-
]
85-
}
86-
],
87-
"no-plusplus": "off",
88-
"no-underscore-dangle": "off",
89-
"no-restricted-syntax": "off",
90-
"class-methods-use-this": "off",
91-
"default-case": "off",
92-
"array-callback-return": "off",
93-
"consistent-return": "off",
94-
"no-console": [
95-
2,
96-
{
97-
"allow": ["info", "warn", "error"]
98-
}
99-
],
100-
"max-len": [
101-
"error",
102-
{
103-
"code": 120,
104-
"ignoreUrls": true,
105-
"ignoreRegExpLiterals": true
106-
}
107-
],
108-
"import/prefer-default-export": "off",
109-
"import/no-extraneous-dependencies": "off",
110-
"react/require-default-props": "off",
111-
"react/button-has-type": "off",
112-
"react/jsx-no-target-blank": "off",
113-
"react/jsx-props-no-spreading": "off",
114-
"react/destructuring-assignment": "off",
115-
"react/no-danger": "off",
116-
"react/no-array-index-key": "off",
117-
"react/state-in-constructor": "off",
118-
"jsx-a11y/anchor-is-valid": "off",
119-
"jsx-a11y/img-redundant-alt": "off",
120-
"jsx-a11y/iframe-has-title": "off",
121-
"jsx-a11y/label-has-associated-control": "off",
122-
"css-modules/no-unused-class": [
123-
2,
124-
{
125-
"camelCase": true
126-
}
127-
],
128-
"css-modules/no-undef-class": [
129-
2,
130-
{
131-
"camelCase": true
132-
}
133-
],
134-
"@typescript-eslint/no-floating-promises": "off",
135-
"@typescript-eslint/restrict-template-expressions": "off",
136-
"@typescript-eslint/no-unused-expressions": "off",
137-
"@typescript-eslint/no-shadow": "off",
138-
"@typescript-eslint/explicit-function-return-type": "off",
139-
"@typescript-eslint/explicit-module-boundary-types": "off",
140-
"@typescript-eslint/unbound-method": "off",
141-
"@typescript-eslint/prefer-regexp-exec": "off",
142-
"@typescript-eslint/camelcase": "off",
143-
"@typescript-eslint/no-empty-function": "off",
144-
"@typescript-eslint/no-var-requires": "off",
145-
"@typescript-eslint/no-unused-vars": [
146-
"error",
147-
{
148-
"argsIgnorePattern": "^_"
149-
}
150-
],
151-
"@typescript-eslint/no-use-before-define": [
152-
"error",
153-
{
154-
"functions": false
155-
}
156-
],
157-
"@typescript-eslint/naming-convention": [
158-
"error",
159-
{
160-
"selector": "variable",
161-
"format": ["camelCase", "UPPER_CASE", "snake_case", "PascalCase"],
162-
"leadingUnderscore": "allow"
163-
}
164-
]
165-
}
70+
}
71+
],
72+
"no-restricted-imports": [
73+
"error",
74+
{
75+
"paths": [
76+
{
77+
"name": "./",
78+
"message": "Use import from non-index file in the same directory"
79+
},
80+
{
81+
"name": ".",
82+
"message": "Use import from non-index file in the same directory"
83+
}
84+
]
85+
}
86+
],
87+
"no-plusplus": "off",
88+
"no-underscore-dangle": "off",
89+
"no-restricted-syntax": "off",
90+
"class-methods-use-this": "off",
91+
"default-case": "off",
92+
"array-callback-return": "off",
93+
"consistent-return": "off",
94+
"no-console": [
95+
2,
96+
{
97+
"allow": ["info", "warn", "error"]
98+
}
99+
],
100+
"max-len": [
101+
"error",
102+
{
103+
"code": 120,
104+
"ignoreUrls": true,
105+
"ignoreRegExpLiterals": true
106+
}
107+
],
108+
"import/prefer-default-export": "off",
109+
"import/no-extraneous-dependencies": "off",
110+
"react/require-default-props": "off",
111+
"react/button-has-type": "off",
112+
"react/jsx-no-target-blank": "off",
113+
"react/jsx-props-no-spreading": "off",
114+
"react/destructuring-assignment": "off",
115+
"react/no-danger": "off",
116+
"react/no-array-index-key": "off",
117+
"react/state-in-constructor": "off",
118+
"jsx-a11y/anchor-is-valid": "off",
119+
"jsx-a11y/img-redundant-alt": "off",
120+
"jsx-a11y/iframe-has-title": "off",
121+
"jsx-a11y/label-has-associated-control": "off",
122+
"css-modules/no-unused-class": [
123+
2,
124+
{
125+
"camelCase": true
126+
}
127+
],
128+
"css-modules/no-undef-class": [
129+
2,
130+
{
131+
"camelCase": true
132+
}
133+
],
134+
"@typescript-eslint/no-floating-promises": "off",
135+
"@typescript-eslint/restrict-template-expressions": "off",
136+
"@typescript-eslint/no-unused-expressions": "off",
137+
"@typescript-eslint/no-shadow": "off",
138+
"@typescript-eslint/explicit-function-return-type": "off",
139+
"@typescript-eslint/explicit-module-boundary-types": "off",
140+
"@typescript-eslint/unbound-method": "off",
141+
"@typescript-eslint/prefer-regexp-exec": "off",
142+
"@typescript-eslint/camelcase": "off",
143+
"@typescript-eslint/no-empty-function": "off",
144+
"@typescript-eslint/no-var-requires": "off",
145+
"@typescript-eslint/no-unused-vars": [
146+
"error",
147+
{
148+
"argsIgnorePattern": "^_"
149+
}
150+
],
151+
"@typescript-eslint/no-use-before-define": [
152+
"error",
153+
{
154+
"functions": false
155+
}
156+
],
157+
"@typescript-eslint/naming-convention": [
158+
"error",
159+
{
160+
"selector": "variable",
161+
"format": ["camelCase", "UPPER_CASE", "snake_case", "PascalCase"],
162+
"leadingUnderscore": "allow"
163+
}
164+
]
166165
}
166+
}

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run lint:commit

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run lint-staged

.husky/pre-push

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run lint:branch

branch.config.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"branchNameLinter": {
3+
"prefixes": [
4+
"feature",
5+
"fix",
6+
"feature/WEB-",
7+
"hotfix",
8+
"fix/WEB-",
9+
"components/v"
10+
],
11+
"suggestions": {
12+
"components": "components/v0.0.1",
13+
"features": "feature/WEB-",
14+
"feat": "feature/WEB-",
15+
"fix": "fix/WEB-",
16+
"hotfix": "hotfix/"
17+
},
18+
"banned": [
19+
"wip"
20+
],
21+
"skip": [
22+
"skip-ci"
23+
],
24+
"disallowed": [
25+
"master",
26+
"stage"
27+
],
28+
"separator": "/",
29+
"msgBranchBanned": "Branches with the name \"%s\" are not allowed.",
30+
"msgBranchDisallowed": "Pushing to \"%s\" is not allowed, use git-flow.",
31+
"msgPrefixNotAllowed": "Branch prefix \"%s\" is not allowed.",
32+
"msgPrefixSuggestion": "Instead of \"%s\" try \"%s\".",
33+
"msgseparatorRequired": "Branch \"%s\" must contain a separator \"%s\"."
34+
}
35+
}

0 commit comments

Comments
 (0)