Skip to content

Commit

Permalink
feat: added new eslint package and some new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLzq committed Oct 17, 2021
1 parent 804aec5 commit d79426c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
45 changes: 32 additions & 13 deletions lib/src/functions/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = async projectName => {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:typescript-sort-keys/recommended',
'plugin:import/recommended',
'prettier'
],
parser : '@typescript-eslint/parser',
Expand All @@ -26,6 +27,7 @@ module.exports = async projectName => {
plugins: ['@typescript-eslint', 'typescript-sort-keys', 'sort-keys-fix'],
rules : {
'@typescript-eslint/camelcase' : 'off',
'@typescript-eslint/comma-dangle' : ['error', 'never'],
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/naming-convention' : [
'error',
Expand Down Expand Up @@ -55,15 +57,15 @@ module.exports = async projectName => {
curly : ['error', 'multi'],
'eol-last' : ['error', 'always'],
'import/no-extraneous-dependencies': [
'error',
'error',
{
'devDependencies': true
devDependencies: true
}
],
'import/prefer-default-export': 'off',
'key-spacing' : [2, { align: 'colon' }],
'keyword-spacing' : ['error', { after: true, before: true }],
'max-len': [
'max-len' : [
'error',
{
code : 80,
Expand All @@ -75,17 +77,17 @@ module.exports = async projectName => {
ignoreUrls : true
}
],
'newline-before-return' : 'error',
'no-extra-parens' : 'error',
'no-console' : 'off',
'no-param-reassign' : 'off',
'no-plusplus' : 'off',
'no-trailing-spaces' : 'error',
'no-underscore-dangle' : [
'newline-before-return': 'error',
'no-extra-parens' : 'error',
'no-console' : 'off',
'no-param-reassign' : 'off',
'no-plusplus' : 'off',
'no-trailing-spaces' : 'error',
'no-underscore-dangle' : [
'error',
{
'allowAfterThis' : true,
'enforceInMethodNames': false
allowAfterThis : true,
enforceInMethodNames: false
}
],
'object-curly-spacing' : ['error', 'always'],
Expand All @@ -101,7 +103,24 @@ module.exports = async projectName => {
named : 'never',
asyncArrow: 'always'
}
]
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies : ['**/*.test.js'],
optionalDependencies: ['**/*.test.js'],
peerDependencies : ['**/*.test.js']
}
],
'import/extensions': [
2,
{
ts : 'never',
js : 'always',
json: 'always'
}
],
'@typescript-eslint/no-empty-interface': 'off'
}
}
`,
Expand Down
1 change: 1 addition & 0 deletions lib/src/installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module.exports = async ({
@typescript-eslint/parser \
dotenv \
eslint \
eslint-config-airbnb \
eslint-config-airbnb-typescript \
eslint-config-prettier \
eslint-plugin-import \
Expand Down

0 comments on commit d79426c

Please sign in to comment.