Skip to content

Commit

Permalink
Merge pull request #1 from DomoApps/version-rule-fixes
Browse files Browse the repository at this point in the history
Version rule fixes
  • Loading branch information
RickyRoller authored Nov 5, 2020
2 parents 3df2074 + e7b4521 commit 54f92e2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/*
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "@domoapps/eslint-config",
"version": "1.1.0",
"version": "1.2.0",
"main": "src/index.js",
"sideEffects": false,
"repository": "git@git.empdev.domo.com:CustomApps/monorepo.git",
"repository": "git@github.com:DomoApps/eslint-config.git",
"scripts": {
"build": "echo 'no build for eslint-config'",
"prepare": "yarn run build",
"test": "echo 'no tests for eslint-config'",
"test:watch": "yarn run test"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^2.6.1",
"@typescript-eslint/parser": "^2.6.1",
"eslint": "^6.1.0",
"@typescript-eslint/eslint-plugin": "^3.1.0",
"@typescript-eslint/parser": "^3.1.0",
"eslint": "*",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"prettier": "^1.19.1"
"prettier": "*"
}
}
33 changes: 28 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,34 @@ module.exports = {
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/unified-signatures': 'error',
'guard-for-in': 'error',
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/camelcase': 'error',
'@typescript-eslint/class-name-casing': 'error',
'@typescript-eslint/naming-convention': [
'error',
// The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this.
{
selector: 'default',
format: ['camelCase'],
},
// Airbnb recommends PascalCase for classes (23.3), and although Airbnb does not make TypeScript recommendations, we are assuming this rule would similarly apply to anything "type like", including interfaces, type aliases, and enums.
{
selector: 'typeLike',
format: ['PascalCase'],
},
// Allow UPPER_CASE for variables to cater for 23.10
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
},
// Allow any naming convention for properties, because (1) Airbnb does not specify any naming conventions for properties (2) The `camelcase` rule specifically disables checking properties: https://github.com/airbnb/javascript/blob/06b3ab11d9a443ff46f052dd00375e271e5146e6/packages/eslint-config-airbnb-base/rules/style.js#L24
{
selector: 'property',
format: null,
},
// Allow any naming convention for enum members, because Airbnb has no recommendation
{
selector: 'enumMember',
format: null,
},
],
'@typescript-eslint/no-for-in-array': 'error',
'no-restricted-imports': ['error', 'rxjs', 'lodash'],
'no-caller': 'error',
Expand All @@ -85,7 +110,6 @@ module.exports = {
'no-console': 'warn',
'no-debugger': 'warn',
'constructor-super': 'error',
'no-shadow-restricted-names': 'error',
'no-empty': 'error',
'no-shadow': 'error',
'no-sparse-arrays': 'error',
Expand All @@ -94,7 +118,6 @@ module.exports = {
'@typescript-eslint/restrict-plus-operands': 'error',
'use-isnan': 'error',
'arrow-body-style': 'error',
'@typescript-eslint/interface-name-prefix': ['error', 'never'],
'new-parens': 'error',
// TODO: when released, enable this rule
// '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as' }],
Expand Down

0 comments on commit 54f92e2

Please sign in to comment.