Skip to content
This repository has been archived by the owner on Sep 30, 2022. It is now read-only.

Commit

Permalink
chore: [P012-2] setup repo
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornware committed Aug 21, 2021
0 parents commit c1f68d4
Show file tree
Hide file tree
Showing 61 changed files with 14,122 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# Environment Variables - Project Defaults
#
# References:
#
# - https://github.com/entropitor/dotenv-cli

NODE_ENV=development
NODE_OPTIONS=''
TS_NODE_PROJECT="$PWD/tsconfig.json"
8 changes: 8 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Environment Variables - Project - `production`
#
# References:
#
# - https://github.com/entropitor/dotenv-cli

NODE_ENV=production
TS_NODE_PROJECT="$PWD/tsconfig.prod.json"
8 changes: 8 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Environment Variables - Project - `test`
#
# References:
#
# - https://github.com/entropitor/dotenv-cli

NODE_ENV=test
TS_NODE_PROJECT="$PWD/tsconfig.test.json"
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ESLint Ignore
# https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories

.yarn/
build/
coverage/
node_modules/
248 changes: 248 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
const prettierConfig = require('./.prettierrc')

/**
* @file ESLint Configuration
* @see https://eslint.org/docs/user-guide/configuring
* @see https://github.com/prettier/eslint-config-prettier
*/

const EXTENDS = [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:jsdoc/recommended'
]

const PARSER_OPTIONS = {
babelOptions: {},
ecmaFeatures: {
impliedStrict: true,
jsx: false
},
ecmaVersion: 2020,
sourceType: 'module'
}

const PARSER_OPTIONS_TYPESCRIPT = {
...PARSER_OPTIONS,
project: ['./tsconfig.json']
}

const PLUGINS = [
'@typescript-eslint/eslint-plugin',
'jsdoc',
'markdown',
'spellcheck',
'tree-shaking'
]

const RULES = {
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/ban-types': 1,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/member-delimiter-style': [
2,
{
multiline: {
delimiter: 'none',
requireLast: false
}
}
],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-namespace': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-useless-constructor': 1,
'@typescript-eslint/no-var-requires': 1,
eqeqeq: 1,
'import/no-anonymous-default-export': 0,
'jsdoc/check-indentation': 1,
'jsdoc/check-line-alignment': 1,
'jsdoc/check-syntax': 1,
'jsdoc/check-tag-names': [1, { definedTags: ['link'] }],
'jsdoc/no-multi-asterisks': 0,
'jsdoc/no-undefined-types': [
1,
{
definedTypes: ['NodeJS', 'never', 'unknown']
}
],
'jsdoc/require-hyphen-before-param-description': 1,
'jsdoc/require-throws': 1,
'jsdoc/tag-lines': [
1,
'any',
{
count: 1,
noEndLines: false,
tags: {}
}
],
'no-ex-assign': 0,
'prefer-arrow-callback': 2,
'prettier/prettier': [2, prettierConfig],
'sort-keys': [
1,
'asc',
{
caseSensitive: true,
minKeys: 2,
natural: true
}
],
'space-before-function-paren': [
2,
{
anonymous: 'always',
asyncArrow: 'always',
named: 'never'
}
],
'spellcheck/spell-checker': [
2,
{
comments: true,
identifiers: false,
lang: 'en_US',
minLength: 3,
skipIfMatch: [],
skipWordIfMatch: [],
skipWords: [
'argv',
'chp',
'commitlint',
'dto',
'dtos',
'enum',
'enums',
'formatter',
'keyof',
'nullish',
'perf',
'pnv',
'postbuild',
'readonly',
'rebase',
'rimraf',
'stringified',
'tgz',
'tsconfig',
'ttsc',
'typeof',
'usr',
'wip'
],
strings: true
}
]
}

module.exports = {
env: {
es6: true,
node: true
},
extends: EXTENDS,
globals: {},
parser: '@typescript-eslint/parser',
parserOptions: PARSER_OPTIONS_TYPESCRIPT,
plugins: PLUGINS,
rules: RULES,
overrides: [
{
files: ['**/*.js', '**/*.md/*.js'],
parser: `${__dirname}/node_modules/@babel/eslint-parser/lib/index.cjs`,
parserOptions: {
...PARSER_OPTIONS,
requireConfigFile: false
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-var-requires': 0
}
},
{
files: ['*.spec.ts'],
env: {
es6: true,
'jest/globals': true,
node: true
},
extends: EXTENDS.splice(1, 0, 'plugin:jest/recommended'),
rules: {
'jest/no-disabled-tests': 0,
'jest/valid-title': 0
}
},
{
files: ['**/*.d.ts'],
rules: {
'@typescript-eslint/triple-slash-reference': 0
}
},
{
files: ['**/*.interface.ts', '**/*.types.ts'],
rules: {
'jsdoc/check-indentation': 0
}
},
{
files: ['**/.eslintrc.*'],
rules: {
'sort-keys': 0,
'spellcheck/spell-checker': 0
}
},
{
files: ['**/*.md'],
processor: 'markdown/markdown'
},
{
files: ['**/*.md/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: PARSER_OPTIONS_TYPESCRIPT
},
{
files: [
'**/__mocks__/**',
'**/__tests__/**',
'**/scripts/**',
'**/.eslintrc.js',
'commitlint.*',
'jest.*',
'lint-staged.*',
'*.spec.ts'
],
rules: {
'tree-shaking/no-side-effects-in-initialization': 0
}
}
],
root: true,
settings: {
jsdoc: {
augmentsExtendsReplacesDocs: true,
implementsReplacesDocs: true,
mode: 'typescript',
overrideReplacesDocs: true,
structuredTags: {
param: {
required: ['name', 'type']
},
throws: {
name: 'namepath-defining',
required: ['type']
}
},
tagNamePreference: {
augments: 'extends',
constant: 'const',
returns: 'return'
}
}
}
}
Loading

0 comments on commit c1f68d4

Please sign in to comment.