Skip to content

Commit 516cd9f

Browse files
committed
chore: applied linting/formatting to config files
1 parent 9be6137 commit 516cd9f

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

.eslintrc.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ module.exports = {
2525
rules: {
2626
// '@typescript-eslint/ban-ts-ignore': ['off'],
2727
// '@typescript-eslint/camelcase': ['off'],
28-
'@typescript-eslint/explicit-function-return-type': [ 'error', { allowExpressions: true } ], // Enforce return type definitions for functions
28+
'@typescript-eslint/explicit-function-return-type': [
29+
'error',
30+
{ allowExpressions: true },
31+
], // Enforce return type definitions for functions
2932
'@typescript-eslint/explicit-member-accessibility': 'error', // Enforce explicit accessibility modifiers on class properties and methods (public, private, protected)
3033
// '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], // Rule is already defined in eslint core, also not recommended by typescript-eslint - prettier could be used instead
3134
// '@typescript-eslint/interface-name-prefix': ['off'], // Probably not needed
3235
// '@typescript-eslint/member-delimiter-style': [ 'error', { multiline: { delimiter: 'none' } } ], // Propose to disable this rule in favor of prettier as recommended here https://typescript-eslint.io/rules/member-delimiter-style/
33-
'@typescript-eslint/member-ordering': [ // Standardize the order of class members
36+
'@typescript-eslint/member-ordering': [
37+
// Standardize the order of class members
3438
'error',
3539
{
3640
default: {
@@ -50,29 +54,30 @@ module.exports = {
5054
],
5155
'@typescript-eslint/no-explicit-any': 'error', // Disallow usage of the any type
5256
// '@typescript-eslint/no-inferrable-types': ['off'], // Propose to disable this rule - read here why https://typescript-eslint.io/rules/no-inferrable-types/
53-
'@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_' } ], // Disallow unused variables, except for variables starting with an underscore
57+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], // Disallow unused variables, except for variables starting with an underscore
5458
'@typescript-eslint/no-use-before-define': ['off'], // Check if this rule is needed
5559
// '@typescript-eslint/semi': [ 'error', 'always' ], Rule is already defined in eslint core, and also not recommended by typescript-eslint - prettier could be used instead
5660
'no-unused-vars': 'off', // Disable eslint core rule, since it's replaced by @typescript-eslint/no-unused-vars
5761
// Rules from eslint core https://eslint.org/docs/latest/rules/
58-
'array-bracket-spacing': [ 'error', 'never' ], // Disallow spaces inside of array brackets
62+
'array-bracket-spacing': ['error', 'never'], // Disallow spaces inside of array brackets
5963
// 'arrow-body-style': [ 'error', 'as-needed' ], Default is already 'as-needed'
60-
'computed-property-spacing': [ 'error', 'never' ], // Disallow spaces inside of computed properties
61-
'func-style': [ 'warn', 'expression' ], // Enforce function expressions instead of function declarations
62-
indent: [ 'error', 2, { SwitchCase: 1 } ],
64+
'computed-property-spacing': ['error', 'never'], // Disallow spaces inside of computed properties
65+
'func-style': ['warn', 'expression'], // Enforce function expressions instead of function declarations
66+
// indent: ['error', 2, { SwitchCase: 1 }],
6367
'keyword-spacing': 'error', // Enforce spaces after keywords and before parenthesis, e.g. if (condition) instead of if(condition)
64-
'padding-line-between-statements': [ // Require an empty line before return statements
68+
'padding-line-between-statements': [
69+
// Require an empty line before return statements
6570
'error',
6671
{ blankLine: 'always', prev: '*', next: 'return' },
6772
],
6873
// 'newline-before-return': 2, // Deprecated in favor of padding-line-between-statements
6974
'no-console': 0, // Allow console.log statements
70-
'no-multi-spaces': [ 'error', { ignoreEOLComments: false } ], // Disallow multiple spaces except for comments
71-
'no-multiple-empty-lines': [ 'error', { max: 1, maxBOF: 0, maxEOF: 0 } ], // Enforce no empty line at the beginning & end of files and max 1 empty line between consecutive statements
75+
'no-multi-spaces': ['error', { ignoreEOLComments: false }], // Disallow multiple spaces except for comments
76+
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }], // Enforce no empty line at the beginning & end of files and max 1 empty line between consecutive statements
7277
'no-throw-literal': 'error', // Disallow throwing literals as exceptions, e.g. throw 'error' instead of throw new Error('error')
73-
'object-curly-spacing': [ 'error', 'always' ], // Enforce spaces inside of curly braces in objects
78+
'object-curly-spacing': ['error', 'always'], // Enforce spaces inside of curly braces in objects
7479
'prefer-arrow-callback': 'error', // Enforce arrow functions instead of anonymous functions for callbacks
75-
quotes: [ 'error', 'single', { allowTemplateLiterals: true } ], // Enforce single quotes except for template strings
76-
semi: [ 'error', 'always' ], // Require semicolons instead of ASI (automatic semicolon insertion) at the end of statements
77-
}
80+
quotes: ['error', 'single', { allowTemplateLiterals: true }], // Enforce single quotes except for template strings
81+
semi: ['error', 'always'], // Require semicolons instead of ASI (automatic semicolon insertion) at the end of statements
82+
},
7883
};

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"tabWidth": 2,
44
"semi": true,
55
"singleQuote": true,
6-
"bracketSpacing": true
6+
"bracketSpacing": true,
7+
"endOfLine": "lf"
78
}

typedoc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = {
22
out: 'api',
3-
exclude: [ '**/node_modules/**', '**/*.test.ts', '**/*.json' ],
3+
exclude: ['**/node_modules/**', '**/*.test.ts', '**/*.json'],
44
name: 'aws-lambda-powertools-typescript',
55
excludePrivate: true,
66
excludeInternal: true,
77
entryPointStrategy: 'packages',
88
readme: './README.md',
9-
};
9+
};

0 commit comments

Comments
 (0)