Browse Source

added eslint & prettier

master
Adam Piontek 8 months ago
parent
commit
fff786019d
  1. 15
      .eslintrc.js
  2. 5
      .prettierrc
  3. 1334
      package-lock.json
  4. 7
      package.json
  5. 2
      src/index.js
  6. 4
      src/template.pug

15
.eslintrc.js

@ -0,0 +1,15 @@
module.exports = {
env: {
node: true,
browser: true,
commonjs: true,
es2021: true,
},
extends: ['airbnb-base', 'prettier'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-multiple-empty-lines': [2, { max: 2 }],
},
parser: '@babel/eslint-parser',
}

5
.prettierrc

@ -0,0 +1,5 @@
{
"singleQuote": true,
"semi": false,
"endOfLine": "auto"
}

1334
package-lock.json
File diff suppressed because it is too large
View File

7
package.json

@ -18,10 +18,17 @@
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/eslint-parser": "^7.12.1",
"@babel/preset-env": "^7.12.7",
"@prettier/plugin-pug": "^1.13.0",
"babel-loader": "^8.2.2",
"clean-webpack-plugin": "^3.0.0",
"eslint": "^7.15.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-import": "^2.22.1",
"html-webpack-plugin": "^5.0.0-alpha.15",
"prettier": "^2.2.1",
"pug": "^3.0.0",
"pug-loader": "^2.4.0",
"webpack": "^5.10.0",

2
src/index.js

@ -4,4 +4,4 @@ heading.textContent = 'Interesting!'
// Append heading node to the DOM
const app = document.querySelector('#root')
app.append(heading)
app.append(heading)

4
src/template.pug

@ -3,6 +3,6 @@ html(lang='en')
head
title= htmlWebpackPlugin.options.title
body
div(id='root')
#root
//- h1 Adam Pion73k
//- p this is a test paragraph on my test page
//- p this is a test paragraph on my test page
Loading…
Cancel
Save