Skip to content

Commit

Permalink
init: πŸ”‘ Setting JavaScript Env
Browse files Browse the repository at this point in the history
  • Loading branch information
InSeong-So committed Sep 10, 2021
1 parent ae77871 commit 9203abe
Show file tree
Hide file tree
Showing 6 changed files with 5,867 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
node: true, // 'module' is not defined. μ—λŸ¬κ°€ λ°œμƒν•˜λ©΄ κΈ°μž…
},
extends: ['eslint:recommended', 'prettier'],
plugins: ['prettier'],
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
semi: true,
useTabs: false,
tabWidth: 2,
trailingComma: 'all',
printWidth: 80,
bracketSpacing: true,
arrowParens: 'avoid',
endOfLine: 'auto',
},
],
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
};
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'json'],
transform: {
'^.+\\.(js|jsx)?$': 'babel-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|less)$': '<rootDir>/__mocks__/fileMock.js',
},
testMatch: ['<rootDir>/**/*.(js|jsx|ts|tsx)'],
transformIgnorePatterns: ['<rootDir>/node_modules/'],
};
10 changes: 10 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
}
},
"exclude": [
"node_modules",
]
}
Loading

0 comments on commit 9203abe

Please sign in to comment.