Skip to content

Commit 9203abe

Browse files
committed
init: πŸ”‘ Setting JavaScript Env
1 parent ae77871 commit 9203abe

File tree

6 files changed

+5867
-0
lines changed

6 files changed

+5867
-0
lines changed

β€Ž.eslintrc.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
jest: true,
6+
node: true, // 'module' is not defined. μ—λŸ¬κ°€ λ°œμƒν•˜λ©΄ κΈ°μž…
7+
},
8+
extends: ['eslint:recommended', 'prettier'],
9+
plugins: ['prettier'],
10+
parserOptions: {
11+
parser: 'babel-eslint',
12+
ecmaVersion: 12,
13+
sourceType: 'module',
14+
},
15+
rules: {
16+
'prettier/prettier': [
17+
'error',
18+
{
19+
singleQuote: true,
20+
semi: true,
21+
useTabs: false,
22+
tabWidth: 2,
23+
trailingComma: 'all',
24+
printWidth: 80,
25+
bracketSpacing: true,
26+
arrowParens: 'avoid',
27+
endOfLine: 'auto',
28+
},
29+
],
30+
},
31+
overrides: [
32+
{
33+
files: [
34+
'**/__tests__/*.{j,t}s?(x)',
35+
'**/tests/unit/**/*.spec.{j,t}s?(x)',
36+
],
37+
env: {
38+
jest: true,
39+
},
40+
},
41+
],
42+
};

β€Žbabel.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
node: 'current',
8+
},
9+
},
10+
],
11+
],
12+
};

β€Žjest.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'json'],
3+
transform: {
4+
'^.+\\.(js|jsx)?$': 'babel-jest',
5+
},
6+
moduleNameMapper: {
7+
'^@/(.*)$': '<rootDir>/$1',
8+
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
9+
'<rootDir>/__mocks__/fileMock.js',
10+
'\\.(css|less)$': '<rootDir>/__mocks__/fileMock.js',
11+
},
12+
testMatch: ['<rootDir>/**/*.(js|jsx|ts|tsx)'],
13+
transformIgnorePatterns: ['<rootDir>/node_modules/'],
14+
};

β€Žjsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"paths": {
5+
}
6+
},
7+
"exclude": [
8+
"node_modules",
9+
]
10+
}

0 commit comments

Comments
Β (0)