Skip to content

Commit 349dcae

Browse files
committed
Added customizability
1 parent 1bd6aab commit 349dcae

16 files changed

Lines changed: 1299 additions & 248 deletions

.eslintrc.cjs

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
/*
2+
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
3+
https://github.com/typescript-eslint/tslint-to-eslint-config
4+
5+
It represents the closest reasonable ESLint configuration to this
6+
project's original TSLint configuration.
7+
8+
We recommend eventually switching this configuration to extend from
9+
the recommended rulesets in typescript-eslint.
10+
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
11+
12+
Happy linting! 💖
13+
*/
14+
module.exports = {
15+
env: {
16+
browser: true,
17+
es6: true,
18+
},
19+
extends: [
20+
'plugin:@typescript-eslint/recommended',
21+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
22+
'plugin:import/recommended',
23+
'plugin:import/typescript',
24+
'prettier',
25+
],
26+
parser: '@typescript-eslint/parser',
27+
parserOptions: {
28+
project: 'tsconfig.json',
29+
sourceType: 'module',
30+
extraFileExtensions: ['.cjs'],
31+
},
32+
plugins: ['eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow', 'eslint-plugin-react', '@typescript-eslint', 'import'],
33+
rules: {
34+
'@typescript-eslint/adjacent-overload-signatures': 'error',
35+
'@typescript-eslint/array-type': [
36+
'error',
37+
{
38+
default: 'array',
39+
},
40+
],
41+
'@typescript-eslint/ban-types': [
42+
'error',
43+
{
44+
types: {
45+
Object: {
46+
message: 'Avoid using the `Object` type. Did you mean `object`?',
47+
},
48+
Function: {
49+
message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
50+
},
51+
Boolean: {
52+
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
53+
},
54+
Number: {
55+
message: 'Avoid using the `Number` type. Did you mean `number`?',
56+
},
57+
String: {
58+
message: 'Avoid using the `String` type. Did you mean `string`?',
59+
},
60+
Symbol: {
61+
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
62+
},
63+
},
64+
},
65+
],
66+
'@typescript-eslint/consistent-type-assertions': 'error',
67+
'@typescript-eslint/dot-notation': 'error',
68+
'@typescript-eslint/indent': 'off',
69+
'@typescript-eslint/member-delimiter-style': [
70+
'off',
71+
{
72+
multiline: {
73+
delimiter: 'none',
74+
requireLast: true,
75+
},
76+
singleline: {
77+
delimiter: 'semi',
78+
requireLast: false,
79+
},
80+
},
81+
],
82+
'@typescript-eslint/naming-convention': 'error',
83+
'@typescript-eslint/no-empty-function': 'error',
84+
'@typescript-eslint/no-empty-interface': 'error',
85+
'@typescript-eslint/no-explicit-any': 'off',
86+
'@typescript-eslint/no-misused-new': 'error',
87+
'@typescript-eslint/no-namespace': 'error',
88+
'@typescript-eslint/no-parameter-properties': 'off',
89+
'@typescript-eslint/no-shadow': [
90+
'error',
91+
{
92+
hoist: 'all',
93+
},
94+
],
95+
'import/no-unresolved': 'error',
96+
"import/extensions": [
97+
'error',"always", {
98+
ignorePackages: true,
99+
pattern: {
100+
"ts": "never",
101+
}
102+
}
103+
],
104+
'@typescript-eslint/no-unused-expressions': 'error',
105+
'@typescript-eslint/no-use-before-define': 'off',
106+
'@typescript-eslint/no-var-requires': 'error',
107+
'@typescript-eslint/prefer-for-of': 'error',
108+
'@typescript-eslint/prefer-function-type': 'error',
109+
'@typescript-eslint/prefer-namespace-keyword': 'error',
110+
'@typescript-eslint/quotes': 'off',
111+
'@typescript-eslint/semi': ['off', null],
112+
'@typescript-eslint/triple-slash-reference': [
113+
'error',
114+
{
115+
path: 'always',
116+
types: 'prefer-import',
117+
lib: 'always',
118+
},
119+
],
120+
'@typescript-eslint/type-annotation-spacing': 'off',
121+
'@typescript-eslint/unified-signatures': 'error',
122+
'arrow-parens': ['off', 'always'],
123+
'brace-style': ['off', 'off'],
124+
'comma-dangle': 'off',
125+
complexity: 'off',
126+
'constructor-super': 'error',
127+
'dot-notation': 'error',
128+
'eol-last': 'off',
129+
eqeqeq: ['error', 'smart'],
130+
'guard-for-in': 'error',
131+
'id-denylist': [
132+
'error',
133+
'any',
134+
'Number',
135+
'number',
136+
'String',
137+
'string',
138+
'Boolean',
139+
'boolean',
140+
'Undefined',
141+
'undefined',
142+
],
143+
'id-match': 'error',
144+
indent: 'off',
145+
'jsdoc/check-alignment': 'error',
146+
'jsdoc/check-indentation': 'error',
147+
'jsdoc/newline-after-description': 'error',
148+
'linebreak-style': 'off',
149+
'max-classes-per-file': ['error', 1],
150+
'max-len': 'off',
151+
'new-parens': 'off',
152+
'newline-per-chained-call': 'off',
153+
'no-bitwise': 'error',
154+
'no-caller': 'error',
155+
'no-cond-assign': 'error',
156+
'no-console': 'error',
157+
'no-debugger': 'error',
158+
'no-empty': 'error',
159+
'no-empty-function': 'error',
160+
'no-eval': 'error',
161+
'no-extra-semi': 'off',
162+
'no-fallthrough': 'off',
163+
'no-invalid-this': 'off',
164+
'no-irregular-whitespace': 'off',
165+
'no-multiple-empty-lines': 'off',
166+
'no-new-wrappers': 'error',
167+
'no-shadow': 'error',
168+
'no-throw-literal': 'error',
169+
'no-trailing-spaces': 'off',
170+
'no-undef-init': 'error',
171+
'no-underscore-dangle': 'error',
172+
'no-unsafe-finally': 'error',
173+
'no-unused-expressions': 'error',
174+
'no-unused-labels': 'error',
175+
'no-use-before-define': 'off',
176+
'no-var': 'error',
177+
'object-shorthand': 'error',
178+
'one-var': ['error', 'never'],
179+
'padded-blocks': [
180+
'off',
181+
{
182+
blocks: 'never',
183+
},
184+
{
185+
allowSingleLineBlocks: true,
186+
},
187+
],
188+
'prefer-arrow/prefer-arrow-functions': 'error',
189+
'prefer-const': 'error',
190+
'quote-props': 'off',
191+
quotes: 'off',
192+
radix: 'error',
193+
'react/jsx-curly-spacing': 'off',
194+
'react/jsx-equals-spacing': 'off',
195+
'react/jsx-tag-spacing': [
196+
'off',
197+
{
198+
afterOpening: 'allow',
199+
closingSlash: 'allow',
200+
},
201+
],
202+
'react/jsx-wrap-multilines': 'off',
203+
semi: 'off',
204+
'space-before-function-paren': 'off',
205+
'space-in-parens': ['off', 'never'],
206+
'spaced-comment': [
207+
'error',
208+
'always',
209+
{
210+
markers: ['/'],
211+
},
212+
],
213+
'use-isnan': 'error',
214+
'valid-typeof': 'off',
215+
},
216+
ignorePatterns: ['.eslintrc.cjs', 'automatedtests/**/*'],
217+
settings: {
218+
'import/parsers': {
219+
'@typescript-eslint/parser': ['.ts', '.tsx'],
220+
},
221+
'import/resolver': {
222+
typescript: {
223+
alwaysTryTypes: true,
224+
project: './tsconfig.json',
225+
},
226+
},
227+
},
228+
};

.eslintrc.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"singleQuote": true
5+
}

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
A simple logger for your projects
44

55
```js
6-
const Logger = require('@developmentcubed/logger');
6+
const { Logger, LEVEL } = require("@developmentcubed/logger");
77

8-
const logger = new Logger(); // Writes log files to CWD
9-
const logger2 = new Logger('/var/log/project'); // Writes log files to a directory of your choosing
8+
const logger = Logger.createInstance();
109

11-
logger.setLevel(logger.DEBUG);
10+
logger.level = LEVEL.debug;
11+
12+
logger.debug("Hello yes this is a debug message");
13+
logger.info("Hello yes this is a info message with", 3, "args");
14+
logger.success("Spoopy it was a success");
15+
logger.warning("Knock it off dude");
16+
logger.error("Errors everywhere");
17+
logger.notice("Notice me uwu");
1218

13-
logger.debug('Hello yes this is a debug message');
14-
logger.info('Hello yes this is a info message with', 3, 'args');
15-
logger.success('Spoopy it was a success');
16-
logger.warning('Knock it off dude');
17-
logger.error('Errors everywhere');
18-
logger.notice('Notice me uwu');
1919
```
2020

2121
![What it looks like](https://carbon.pics/nIxxICM8i)

package-commonjs.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "commonjs"
3+
}

package-esm.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

package-lock.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)