Skip to content

Commit c4caf2d

Browse files
authored
Merge pull request #1 from ovos/react-functional-components
allow capitalized functions (react's function components)
2 parents a11742b + 7efa895 commit c4caf2d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ovos-media/coding-standard",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "ovos-media Coding Standard",
55
"main": "index.js",
66
"types": "index.d.ts",

tslint.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ const rules : tslint.Configuration.RawRulesConfig = Object.assign({}, rulesAirbn
4242
ignoreStrings: true,
4343
ignoreTemplateLiterals: true,
4444
}],
45+
'function-name': [
46+
true,
47+
{
48+
'function-regex': /^[a-zA-Z$][a-zA-Z\d]+$/, // allow React function components
49+
'method-regex': /^[a-z$][a-zA-Z\d]+$/,
50+
'private-method-regex': /^[a-z$][a-zA-Z\d]+$/,
51+
'protected-method-regex': /^[a-z$][a-zA-Z\d]+$/,
52+
'static-method-regex': /^[a-z$][a-zA-Z\d]+$/,
53+
},
54+
],
4555
'variable-name': false,
4656
'no-this-assignment': [true, {'allow-destructuring': true}],
4757
'import-name': false, // from tslint-microsoft-contrib

0 commit comments

Comments
 (0)