Skip to content

Commit

Permalink
fix eslint and prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
manjillama committed Jul 31, 2021
1 parent d8ec221 commit a9fc76a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 18 deletions.
58 changes: 47 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,57 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
env: {
es6: true,
node: true,
'jest/globals': true,
},
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 11,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'jest'],
ignorePatterns: ['**/dist/**'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'no-console': 'warn',
'import/prefer-default-export': 'off',
'func-names': 'off',
'lines-between-class-members': 'off',
'no-return-await': 'off',
'consistent-return': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: 'error|req|res|val' }],
'no-underscore-dangle': 'off',
'prefer-destructuring': 'off',
'class-methods-use-this': 'off',
camelcase: 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: 'req|res|next|val' },
{ argsIgnorePattern: 'error|req|res|val' },
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'@typescript-eslint/ban-types': 'off',
},
};
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"tabWidth": 2,
"printWidth": 120,
"singleQuote": true,
"tabWidth": 2
"trailingComma": "none"
}
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ const PORT = process.env.PORT || 5000;

app.listen(PORT, () => {
logger.info(`✅ Server listening on port ${PORT}`);
logger.info(
`🚀 Deploy stage: ${process.env.NODE_ENV}${
process.env.STAGING ? ' staging' : ''
}`,
);
logger.info(`🚀 Deploy stage: ${process.env.NODE_ENV}${process.env.STAGING ? ' staging' : ''}`);
});

0 comments on commit a9fc76a

Please sign in to comment.