20
loading...
This website collects cookies to deliver better user experience
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.js"></script>
</body>
</html>
import './style.css'
const hello = 'WASSUP GUYS' // 'hello' is declared but its value is never read
npm init @vitejs/app
cd *your project name*
npm install
npm run dev
npm install -D eslint prettier eslint-config-prettier
{
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"devDependencies": {
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"prettier": "^2.3.2",
"vite": "^2.3.8"
}
}
npx eslint --init
on the terminal. And follow the following steps.How would you like to use ESLint? · To check syntax and find problems
√ What type of modules does your project use? · JavaScript modules (import/export)
√ Which framework does your project use? · none
√ Does your project use TypeScript? · No
√ Where does your code run? · browser
√ What format do you want your config file to be in? · JavaScript
// eslint-disable-next-line no-undef
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: ['eslint:recommended', 'prettier'],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
rules: {},
}
.prettierrc
file in your project directory and for testing, we will add these two rules.{
"semi": false,
"singleQuote": true
}
import './style.css'
const hello = 'WASSUP GUYS'