Skip to content

Commit

Permalink
feat(eslint): migrate rest of custom rules to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Naumov [MBP15] committed Nov 21, 2019
1 parent 47ae996 commit 92f4a80
Show file tree
Hide file tree
Showing 17 changed files with 12,982 additions and 558 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.fixture.*
29 changes: 29 additions & 0 deletions eslint/angular/conventions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
const breaking = require('../utils/breaking');

module.exports = {
rules: {
'@typescript-eslint/class-name-casing': 'error',

'@typescript-eslint/member-ordering': 'off',
'@tinkoff/member-ordering': [
breaking({since: 2}),
{
classes: [
'private-instance-field',
'private-static-field',
'protected-static-field',
'protected-instance-field',
'public-instance-field',
'public-static-field',
'@Input',
'@Output',
'public-instance-get',
'public-instance-set',
'protected-instance-get',
'protected-instance-set',
'private-instance-get',
'private-instance-set',
'public-instance-method',
'public-static-method',
'protected-instance-method',
'protected-static-method',
'private-instance-method',
'private-static-method',
],
},
],
},
};
19 changes: 1 addition & 18 deletions eslint/common/typescript/conventions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const path = require('path');
const breaking = require('../../utils/breaking');

module.exports = {
Expand Down Expand Up @@ -39,22 +38,6 @@ module.exports = {
before: 'off',
after: 'warn',
}),
'@typescript-eslint/explicit-function-return-type': 'off',

// Runs an instance of TSLint within your ESLint setup
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint
'@typescript-eslint/tslint/config': [
breaking({since: 2}), // 'tinkoff-angular-member-ordering' was recently changed
{
rules: {
eofline: true, // Dummy rule to supress "Tried to lint [file] but found no valid, enabled rules for this file type and file path in the resolved configuration."
'tinkoff-method-return-type': true,
'tinkoff-new-line-after-variable-declaration': true,
// 'tinkoff-new-line-around-control-statement': true, // replaced with padding-line-between-statements
'tinkoff-angular-member-ordering': true,
},
rulesDirectory: [path.join(__dirname, '../../../tslint/rules')],
},
],
'@tinkoff/require-return-type': 'error',
},
};
7 changes: 6 additions & 1 deletion eslint/common/typescript/enviroment.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ module.exports = {
project: './tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint', '@typescript-eslint/tslint', 'functional'],
plugins: [
'@typescript-eslint',
'@typescript-eslint/tslint',
'functional',
'@tinkoff',
],
};
6 changes: 6 additions & 0 deletions eslint/rules/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
rules: {
'member-ordering': require('./member-ordering'),
'require-return-type': require('./require-return-type'),
},
};
Loading

0 comments on commit 92f4a80

Please sign in to comment.