Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
chore: Add formatting and linting configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjuaneight committed Nov 6, 2021
1 parent 95f4649 commit 18e8919
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
coverage
dist
node_modules
70 changes: 70 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const prettierConf = require('./prettier.config');

module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'airbnb-base',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'prettier',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
tw: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
classes: true,
impliedStrict: true,
jsx: true,
},
sourceType: 'module',
},
plugins: ['prettier', '@typescript-eslint'],
rules: {
'id-length': [
2,
{
exceptions: ['_', 'a', 'b', 'c', 'i', 'x', 'y', 'z'],
},
],
'import/extensions': 0,
'import/no-unresolved': [2, { caseSensitive: false }],
'import/prefer-default-export': 0,
'no-await-in-loop': 0,
'no-console': [
'error',
{
allow: ['error', 'info'],
},
],
'no-case-declarations': 0,
'no-nested-ternary': 0,
'no-restricted-syntax': [
'error',
'FunctionExpression',
'WithStatement',
"BinaryExpression[operator='in']",
],
'prettier/prettier': ['error', prettierConf],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
},
};
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
.env
*.log
*.pid
*.seed
coverage
dist
lib-cov
logs
node_modules
21 changes: 21 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
arrowParens: 'avoid',
bracketSpacing: true,
endOfLine: 'auto',
overrides: [
{
files: '*.json',
options: {
printWidth: 200,
},
},
],
printWidth: 80,
proseWrap: 'preserve',
requirePragma: false,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: false,
};

0 comments on commit 18e8919

Please sign in to comment.