├── .prettierignore
├── src
├── font
│ └── Caveat
│ │ ├── static
│ │ ├── Caveat-Bold.ttf
│ │ ├── Caveat-Medium.ttf
│ │ ├── Caveat-Regular.ttf
│ │ └── Caveat-SemiBold.ttf
│ │ ├── Caveat-VariableFont_wght.ttf
│ │ ├── README.txt
│ │ └── OFL.txt
├── random.js
├── index.js
├── template.html
├── userData.js
├── img
│ └── note.svg
└── style
│ └── main.scss
├── .editorconfig
├── prettier.config.mjs
├── LICENSE
├── README.md
├── .vscode
└── settings.json
├── eslint.config.mjs
├── package.json
├── .gitignore
├── webpack.config.cjs
└── help
└── eslint-recommended.js
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Ignore artifacts:
2 | dist
3 | coverage
4 |
5 | # Ignore all HTML files:
6 | # *.html
--------------------------------------------------------------------------------
/src/font/Caveat/static/Caveat-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iwebexpert/js-middle-eslint-template/HEAD/src/font/Caveat/static/Caveat-Bold.ttf
--------------------------------------------------------------------------------
/src/font/Caveat/static/Caveat-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iwebexpert/js-middle-eslint-template/HEAD/src/font/Caveat/static/Caveat-Medium.ttf
--------------------------------------------------------------------------------
/src/font/Caveat/static/Caveat-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iwebexpert/js-middle-eslint-template/HEAD/src/font/Caveat/static/Caveat-Regular.ttf
--------------------------------------------------------------------------------
/src/font/Caveat/static/Caveat-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iwebexpert/js-middle-eslint-template/HEAD/src/font/Caveat/static/Caveat-SemiBold.ttf
--------------------------------------------------------------------------------
/src/font/Caveat/Caveat-VariableFont_wght.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iwebexpert/js-middle-eslint-template/HEAD/src/font/Caveat/Caveat-VariableFont_wght.ttf
--------------------------------------------------------------------------------
/src/random.js:
--------------------------------------------------------------------------------
1 | export function getRandomInt(min, max) {
2 | min = Math.ceil(min)
3 | max = Math.floor(max)
4 | return Math.floor(Math.random() * (max - min + 1)) + min
5 | }
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 2
9 | end_of_line = lf
10 | charset = utf-8
11 | trim_trailing_whitespace = false
12 | insert_final_newline = false
13 | max_line_length = 80
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import updateUser from './userData'
2 |
3 | import './style/main.scss'
4 | import noteImg from './img/note.svg'
5 |
6 | const mainImg = document.querySelector('.main-img')
7 | mainImg.src = noteImg
8 |
9 | const mainButton = document.querySelector('.main-btn')
10 | mainButton.addEventListener('click', updateUser)
11 | updateUser()
12 |
--------------------------------------------------------------------------------
/prettier.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('prettier').Config} */
2 | const config = {
3 | trailingComma: 'es5', // es5, all, none
4 | // tabWidth: 2,
5 | // useTabs: false,
6 | // printWidth: 80,
7 | semi: false,
8 | singleQuote: true,
9 | bracketSpacing: true,
10 | arrowParens: 'always', // always, avoid
11 | // endOfLine: 'lf', // lf, crlf, cr, auto
12 |
13 | // requirePragma: true,
14 | // insertPragma: true,
15 |
16 | // HTML, Vue, JSX
17 | singleAttributePerLine: true,
18 | bracketSameLine: false,
19 | }
20 |
21 | export default config
22 |
--------------------------------------------------------------------------------
/src/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | <%= htmlWebpackPlugin.options.title %>
8 |
9 |
10 |
11 |
![]()
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/userData.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 | import { getRandomInt } from './random'
3 |
4 | function updateUser() {
5 | // fetch(`https://jsonplaceholder.typicode.com/users/${getRandomInt(1, 10)}`)
6 | // .then((result) => res.json())
7 | // .then((result) => {
8 | // document.querySelector('.user-name').textContent = result.name
9 | // document.querySelector('.user-amount').innerHTML = getRandomInt(1000, 10000) + ' ₽'
10 | // document.querySelector('.user-email').textContent = result.email
11 | // })
12 |
13 | axios
14 | .get(`https://jsonplaceholder.typicode.com/users/${getRandomInt(1, 10)}`)
15 | .then((result) => {
16 | document.querySelector('.user-name').textContent = result.data.name
17 | document.querySelector('.user-amount').innerHTML =
18 | getRandomInt(1000, 10_000) + ' ₽'
19 | document.querySelector('.user-email').textContent = result.data.email
20 | })
21 | }
22 |
23 | export default updateUser
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Igor Filimonov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/img/note.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Шаблон конфигурации ESLint
2 | За основу конфигурации ESLint взяты правила из `eslint:recommended`. Описание всех основных правил из `eslint:recommended` можно посмотреть в файле [help/eslint-recommended.js](./help/eslint-recommended.js).
3 |
4 | В файл `.vscode/settings.json` добавлены необходимые настройки `VS Code` для интеграции с ESLint и Prettier.
5 | `Prettier` запускается с помощью плагина [eslint-plugin-prettier](https://www.npmjs.com/package/eslint-plugin-prettier).
6 |
7 | ## Плагин для VS Code
8 | Для подсветки ошибок в IDE во время процесса веб-разработки необходимо дополнительно установить расширение [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) для VS Code.
9 |
10 | ## Установка зависимостей проекта
11 | ```
12 | npm install
13 | ```
14 |
15 | ## Проверка форматирования кода проекта
16 | ```
17 | npm run prettier
18 | ```
19 |
20 | ## Исправление форматирования кода с помощью Prettier
21 | ```
22 | npm run prettier:fix
23 | ```
24 |
25 | ## Проверка качества кода с помощью ESLint
26 | ```
27 | npm run lint
28 | ```
29 |
30 | ## Исправление кода с использованием ESLint и Prettier
31 | ```
32 | npm run lint:fix
33 | ```
34 |
35 | ## Лицензия
36 | 
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | // Вариант 1
3 | // "prettier.enable": true,
4 | // "eslint.enable": true,
5 | // "eslint.format.enable": true,
6 | // "eslint.run": "onType",
7 | // "[javascript]": {
8 | // "editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
9 | // "editor.formatOnPaste": false, // required
10 | // "editor.formatOnType": false, // required
11 | // "editor.formatOnSave": true, // optional
12 | // "editor.formatOnSaveMode": "file", // required to format on save
13 | // },
14 |
15 | // Вариант 2
16 | "eslint.enable": true,
17 | "eslint.format.enable": true,
18 | "eslint.run": "onType",
19 | "eslint.probe": [
20 | "javascript",
21 | "javascriptreact",
22 | "typescript",
23 | "typescriptreact"
24 | ],
25 | "eslint.rules.customizations": [
26 | { "rule": "prettier/prettier", "severity": "info" }
27 | ],
28 | "[javascript]": {
29 | "editor.defaultFormatter": "dbaeumer.vscode-eslint",
30 | "editor.formatOnPaste": true,
31 | // "editor.formatOnSave": true,
32 | "editor.codeActionsOnSave": ["source.fixAll.eslint"]
33 | },
34 |
35 | "workbench.colorCustomizations": {
36 | // "editorError.foreground": "#f90000",
37 | "editorInfo.foreground": "#15c804",
38 | "editorWarning.foreground": "#fca80b"
39 | },
40 | "eslint.useFlatConfig": true
41 | }
42 |
--------------------------------------------------------------------------------
/src/style/main.scss:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Caveat';
3 | src: url('../font/Caveat/Caveat-VariableFont_wght.ttf') format('truetype');
4 | font-weight: 400;
5 | font-style: normal;
6 | }
7 |
8 | $bg-color: #66ba7c;
9 | $page-color: #eeecec;
10 | $box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15), 0 8px 8px rgba(0, 0, 0, 0.15);
11 |
12 |
13 | body {
14 | background-color: $bg-color;
15 | font-family: 'Caveat', sans-serif;
16 | display: flex;
17 | align-items: center;
18 | justify-content: center;
19 | height: 100vh;
20 | // overflow: hidden;
21 | padding: 30px;
22 | margin: 0;
23 | box-sizing: border-box;
24 | }
25 |
26 | .container {
27 | width: 768px;
28 | background-color: $page-color;
29 | box-shadow: $box-shadow;
30 | border-radius: 10px;
31 | padding: 40px 15px;
32 | text-align: center;
33 | }
34 |
35 | img.main-img {
36 | width: 108px;
37 | margin-bottom: 25px;
38 | }
39 |
40 | .header {
41 | font-size: 24px;
42 | color: #999;
43 | letter-spacing: 2px;
44 | }
45 |
46 | .user-info {
47 | font-size: 28px;
48 | letter-spacing: 1.5px;
49 | margin: 25px auto;
50 | }
51 |
52 | .main-btn {
53 | margin-top: 30px;
54 | background-color: $bg-color;
55 | color: $page-color;
56 | border: 0;
57 | border-radius: 12px;
58 | padding: 12px 35px;
59 | font-size: 18px;
60 | cursor: pointer;
61 |
62 | &:hover {
63 | transform: scale(1.05);
64 | }
65 | }
--------------------------------------------------------------------------------
/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | import js from '@eslint/js'
2 | import globals from 'globals'
3 | import prettier from 'eslint-plugin-prettier'
4 | import prettierConfig from 'eslint-config-prettier'
5 | import eslintPluginUnicorn from 'eslint-plugin-unicorn'
6 | import reactHooks from 'eslint-plugin-react-hooks'
7 | import reactRefresh from 'eslint-plugin-react-refresh'
8 | import tsEslint from 'typescript-eslint'
9 |
10 | export default tsEslint.config([
11 | { ignores: ['dist', 'help', '**/*.cjs'] },
12 | {
13 | extends: [
14 | js.configs.recommended,
15 | eslintPluginUnicorn.configs['flat/recommended'],
16 | ...tsEslint.configs.recommended,
17 | prettierConfig,
18 | ],
19 | files: ['**/*.{js,jsx,ts,tsx,mjs}'],
20 | languageOptions: {
21 | ecmaVersion: 'latest',
22 | // sourceType: 'module',
23 | globals: globals.browser,
24 | // globals: { ...globals.browser, ...globals.node },
25 | },
26 | plugins: {
27 | 'react-hooks': reactHooks,
28 | 'react-refresh': reactRefresh,
29 | prettier: prettier,
30 | },
31 | rules: {
32 | ...reactHooks.configs.recommended.rules,
33 | 'react-refresh/only-export-components': 'warn',
34 | 'prettier/prettier': 'error',
35 | 'arrow-body-style': 'off',
36 | 'prefer-arrow-callback': 'off',
37 | 'no-console': [
38 | 'error',
39 | {
40 | allow: ['info', 'error'],
41 | },
42 | ],
43 | 'no-var': 'error',
44 | 'no-use-before-define': 'error',
45 | eqeqeq: 'warn',
46 | camelcase: 'error',
47 | 'unicorn/filename-case': 'off',
48 | },
49 | },
50 | ])
51 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "js-middle-eslint-template",
3 | "version": "1.0.0",
4 | "description": " ESLint Configuration Template",
5 | "main": "./src/index.js",
6 | "scripts": {
7 | "prettier": "prettier --check ./src/**/*.js",
8 | "prettier:fix": "prettier --write ./src/**/*.js",
9 | "lint": "eslint .",
10 | "lint:fix": "eslint --fix .",
11 | "build": "webpack --mode production --node-env=production",
12 | "dev": "webpack --mode development --node-env=development",
13 | "watch": "webpack --watch --mode development --node-env=development",
14 | "serve": "webpack serve --mode development --node-env=development",
15 | "test": "echo \"Error: no test specified\" && exit 1"
16 | },
17 | "keywords": [],
18 | "author": "Igor Filimonov",
19 | "license": "MIT",
20 | "private": true,
21 | "bugs": {
22 | "url": "https://github.com/iwebexpert/js-middle-eslint-template/issues"
23 | },
24 | "homepage": "https://github.com/iwebexpert/js-middle-eslint-template#readme",
25 | "devDependencies": {
26 | "@babel/core": "^7.26.0",
27 | "@babel/eslint-parser": "^7.25.9",
28 | "@babel/preset-env": "^7.26.0",
29 | "@eslint/js": "^9.17.0",
30 | "babel-loader": "^9.2.1",
31 | "clean-webpack-plugin": "^4.0.0",
32 | "css-loader": "^7.1.2",
33 | "eslint": "^9.17.0",
34 | "eslint-config-prettier": "^9.1.0",
35 | "eslint-plugin-prettier": "^5.2.1",
36 | "eslint-plugin-react-hooks": "^5.1.0",
37 | "eslint-plugin-react-refresh": "^0.4.16",
38 | "eslint-plugin-unicorn": "^56.0.1",
39 | "globals": "^15.14.0",
40 | "html-webpack-plugin": "^5.6.3",
41 | "mini-css-extract-plugin": "^2.9.2",
42 | "prettier": "3.4.2",
43 | "sass": "^1.83.0",
44 | "sass-loader": "^16.0.4",
45 | "style-loader": "^4.0.0",
46 | "typescript-eslint": "^8.18.2",
47 | "webpack": "^5.97.1",
48 | "webpack-bundle-analyzer": "^4.10.2",
49 | "webpack-cli": "^6.0.1",
50 | "webpack-dev-server": "^5.2.0"
51 | },
52 | "dependencies": {
53 | "axios": "^1.7.9"
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 |
40 | # Dependency directories
41 | node_modules/
42 | jspm_packages/
43 |
44 | # TypeScript v1 declaration files
45 | typings/
46 |
47 | # TypeScript cache
48 | *.tsbuildinfo
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Microbundle cache
57 | .rpt2_cache/
58 | .rts2_cache_cjs/
59 | .rts2_cache_es/
60 | .rts2_cache_umd/
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 | .env.test
74 |
75 | # parcel-bundler cache (https://parceljs.org/)
76 | .cache
77 |
78 | # Next.js build output
79 | .next
80 |
81 | # Nuxt.js build / generate output
82 | .nuxt
83 | dist
84 |
85 | # Gatsby files
86 | .cache/
87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
88 | # https://nextjs.org/blog/next-9-1#public-directory-support
89 | # public
90 |
91 | # vuepress build output
92 | .vuepress/dist
93 |
94 | # Serverless directories
95 | .serverless/
96 |
97 | # FuseBox cache
98 | .fusebox/
99 |
100 | # DynamoDB Local files
101 | .dynamodb/
102 |
103 | # TernJS port file
104 | .tern-port
105 |
--------------------------------------------------------------------------------
/src/font/Caveat/README.txt:
--------------------------------------------------------------------------------
1 | Caveat Variable Font
2 | ====================
3 |
4 | This download contains Caveat as both a variable font and static fonts.
5 |
6 | Caveat is a variable font with this axis:
7 | wght
8 |
9 | This means all the styles are contained in a single file:
10 | Caveat-VariableFont_wght.ttf
11 |
12 | If your app fully supports variable fonts, you can now pick intermediate styles
13 | that aren’t available as static fonts. Not all apps support variable fonts, and
14 | in those cases you can use the static font files for Caveat:
15 | static/Caveat-Regular.ttf
16 | static/Caveat-Medium.ttf
17 | static/Caveat-SemiBold.ttf
18 | static/Caveat-Bold.ttf
19 |
20 | Get started
21 | -----------
22 |
23 | 1. Install the font files you want to use
24 |
25 | 2. Use your app's font picker to view the font family and all the
26 | available styles
27 |
28 | Learn more about variable fonts
29 | -------------------------------
30 |
31 | https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
32 | https://variablefonts.typenetwork.com
33 | https://medium.com/variable-fonts
34 |
35 | In desktop apps
36 |
37 | https://theblog.adobe.com/can-variable-fonts-illustrator-cc
38 | https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
39 |
40 | Online
41 |
42 | https://developers.google.com/fonts/docs/getting_started
43 | https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
44 | https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
45 |
46 | Installing fonts
47 |
48 | MacOS: https://support.apple.com/en-us/HT201749
49 | Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
50 | Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
51 |
52 | Android Apps
53 |
54 | https://developers.google.com/fonts/docs/android
55 | https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
56 |
57 | License
58 | -------
59 | Please read the full license text (OFL.txt) to understand the permissions,
60 | restrictions and requirements for usage, redistribution, and modification.
61 |
62 | You can use them in your products & projects – print or digital,
63 | commercial or otherwise.
64 |
65 | This isn't legal advice, please consider consulting a lawyer and see the full
66 | license for all details.
67 |
--------------------------------------------------------------------------------
/webpack.config.cjs:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const HtmlWebpackPlugin = require('html-webpack-plugin')
3 | const MiniCssExtractPlugin = require("mini-css-extract-plugin")
4 | // const { CleanWebpackPlugin } = require('clean-webpack-plugin')
5 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
6 |
7 | const isProduction = process.env.NODE_ENV === 'production'
8 | const styleLoaderHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader'
9 |
10 | module.exports = {
11 | // mode: 'production',
12 | entry: path.resolve(__dirname, 'src', 'index.js'),
13 | output: {
14 | path: path.resolve(__dirname, 'dist'),
15 | filename: '[name][contenthash].js',
16 | clean: true,
17 | assetModuleFilename: 'assets/[name][hash][ext]',
18 | },
19 | devtool: (isProduction) ? 'source-map' : 'eval-source-map',
20 | devServer: {
21 | static: {
22 | directory: path.resolve(__dirname, 'dist'),
23 | },
24 | host: 'localhost',
25 | port: 3000,
26 | open: true,
27 | hot: true,
28 | compress: true,
29 | historyApiFallback: true,
30 | onListening: function(devServer){
31 | if(isProduction){
32 | throw new Error('webpack-dev-server is not allowed')
33 | }
34 |
35 | const port = devServer.server.address().port
36 | console.log(`Port: ${port}`)
37 | },
38 | },
39 | module: {
40 | rules: [
41 | {
42 | test: /\.s?css$/i,
43 | use: [styleLoaderHandler, "css-loader", 'sass-loader'],
44 | },
45 | {
46 | test: /\.(png|svg|jpg|jpeg|gif)$/i,
47 | type: 'asset/resource',
48 | },
49 | {
50 | test: /\.(woff|woff2|eot|ttf|otf)$/i,
51 | type: 'asset/resource',
52 | generator: {
53 | filename: 'fonts/[hash][ext]',
54 | },
55 | },
56 | {
57 | test: /\.m?js$/,
58 | exclude: /node_modules/,
59 | use: {
60 | loader: "babel-loader",
61 | options: {
62 | cacheDirectory: true,
63 | presets: ['@babel/preset-env'],
64 | }
65 | }
66 | },
67 | ],
68 | },
69 | plugins: [
70 | new HtmlWebpackPlugin({
71 | template: path.resolve(__dirname, 'src', 'template.html'),
72 | favicon: path.resolve(__dirname, 'src', 'img', 'note.svg'),
73 | filename: 'index.html',
74 | title: 'Приложение для электронных чеков v1.0.0',
75 | }),
76 | // new CleanWebpackPlugin(),
77 | new MiniCssExtractPlugin({
78 | filename: 'css/[name][contenthash].css',
79 | }),
80 | new BundleAnalyzerPlugin({
81 | analyzerMode: 'static',
82 | defaultSizes: 'gzip',
83 | analyzerPort: 3001,
84 | reportTitle: 'Основной отчет',
85 | reportFilename: 'stats.html',
86 | openAnalyzer: false,
87 | generateStatsFile: true,
88 | statsFilename: 'stats.json',
89 | }),
90 | ],
91 | }
92 |
--------------------------------------------------------------------------------
/src/font/Caveat/OFL.txt:
--------------------------------------------------------------------------------
1 | Copyright 2014 The Caveat Project Authors (https://github.com/googlefonts/caveat)
2 |
3 | This Font Software is licensed under the SIL Open Font License, Version 1.1.
4 | This license is copied below, and is also available with a FAQ at:
5 | http://scripts.sil.org/OFL
6 |
7 |
8 | -----------------------------------------------------------
9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10 | -----------------------------------------------------------
11 |
12 | PREAMBLE
13 | The goals of the Open Font License (OFL) are to stimulate worldwide
14 | development of collaborative font projects, to support the font creation
15 | efforts of academic and linguistic communities, and to provide a free and
16 | open framework in which fonts may be shared and improved in partnership
17 | with others.
18 |
19 | The OFL allows the licensed fonts to be used, studied, modified and
20 | redistributed freely as long as they are not sold by themselves. The
21 | fonts, including any derivative works, can be bundled, embedded,
22 | redistributed and/or sold with any software provided that any reserved
23 | names are not used by derivative works. The fonts and derivatives,
24 | however, cannot be released under any other type of license. The
25 | requirement for fonts to remain under this license does not apply
26 | to any document created using the fonts or their derivatives.
27 |
28 | DEFINITIONS
29 | "Font Software" refers to the set of files released by the Copyright
30 | Holder(s) under this license and clearly marked as such. This may
31 | include source files, build scripts and documentation.
32 |
33 | "Reserved Font Name" refers to any names specified as such after the
34 | copyright statement(s).
35 |
36 | "Original Version" refers to the collection of Font Software components as
37 | distributed by the Copyright Holder(s).
38 |
39 | "Modified Version" refers to any derivative made by adding to, deleting,
40 | or substituting -- in part or in whole -- any of the components of the
41 | Original Version, by changing formats or by porting the Font Software to a
42 | new environment.
43 |
44 | "Author" refers to any designer, engineer, programmer, technical
45 | writer or other person who contributed to the Font Software.
46 |
47 | PERMISSION & CONDITIONS
48 | Permission is hereby granted, free of charge, to any person obtaining
49 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
50 | redistribute, and sell modified and unmodified copies of the Font
51 | Software, subject to the following conditions:
52 |
53 | 1) Neither the Font Software nor any of its individual components,
54 | in Original or Modified Versions, may be sold by itself.
55 |
56 | 2) Original or Modified Versions of the Font Software may be bundled,
57 | redistributed and/or sold with any software, provided that each copy
58 | contains the above copyright notice and this license. These can be
59 | included either as stand-alone text files, human-readable headers or
60 | in the appropriate machine-readable metadata fields within text or
61 | binary files as long as those fields can be easily viewed by the user.
62 |
63 | 3) No Modified Version of the Font Software may use the Reserved Font
64 | Name(s) unless explicit written permission is granted by the corresponding
65 | Copyright Holder. This restriction only applies to the primary font name as
66 | presented to the users.
67 |
68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69 | Software shall not be used to promote, endorse or advertise any
70 | Modified Version, except to acknowledge the contribution(s) of the
71 | Copyright Holder(s) and the Author(s) or with their explicit written
72 | permission.
73 |
74 | 5) The Font Software, modified or unmodified, in part or in whole,
75 | must be distributed entirely under this license, and must not be
76 | distributed under any other license. The requirement for fonts to
77 | remain under this license does not apply to any document created
78 | using the Font Software.
79 |
80 | TERMINATION
81 | This license becomes null and void if any of the above conditions are
82 | not met.
83 |
84 | DISCLAIMER
85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93 | OTHER DEALINGS IN THE FONT SOFTWARE.
94 |
--------------------------------------------------------------------------------
/help/eslint-recommended.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // eslint:recommended
3 | 'constructor-super': 'error', // проверка вызова super() в конструкторе
4 | 'for-direction': 'error', // проверка цикла for на конечное число итераций
5 | 'getter-return': 'error', // обязательный return в class getter
6 | 'no-async-promise-executor': 'error', // запрет async функции-исполнителя в Promise
7 | 'no-case-declarations': 'error', // запрет объявления переменных, функций и классов в конструкции switch case
8 | 'no-class-assign': 'error', // class My {} — запрет на приваивание нового значения экземпляру класса My
9 | 'no-compare-neg-zero': 'error', // запрет на сравнение x === -0
10 | 'no-cond-assign': 'error', // запрет на присваивание в условиях (if/for/тернарный оператор)
11 | 'no-const-assign': 'error', // запрет на изменение константы (const)
12 | 'no-constant-condition': 'error', // запрет на константу в условии if, for, while, ?:. Например, if (false) {}
13 | 'no-control-regex': 'error', // запрет на упр.символы в регулярках (ASCII от 0 до 31). var pattern1 = /\x00/;
14 | 'no-debugger': 'error', // запрет на использование debugger
15 | 'no-delete-var': 'error', // запрет на использование оператора delete с переменной
16 | 'no-dupe-args': 'error', // запрет одинаковых параметров в объявлений функции
17 | 'no-dupe-class-members': 'error', // запрет повторяющихся членов (методов и свойств) класса
18 | // class Foo {
19 | // bar() { }
20 | // bar() { }
21 | // }
22 | 'no-dupe-else-if': 'error', // запрет повторяющихся условий в цепочках if-else-if
23 | 'no-dupe-keys': 'error', // запрет повторяющихся ключей в литералах объектов
24 | // var foo = {
25 | // bar: 'baz',
26 | // bar: 'qux'
27 | // };
28 | 'no-duplicate-case': 'error', // запрет повторяющихся значений switch case
29 | 'no-empty': 'error', // запрет пустых блоков кода — if(…) {}
30 | 'no-empty-character-class': 'error', // запрет на пустые символьные классы [] в RegExp (/^abc[]/.test("abcdefg"))
31 | 'no-empty-pattern': 'error', // запрет пустых шаблонов деструктуризации let {} = bar
32 | 'no-ex-assign': 'error', // запрет переназначения err в catch — try {…} catch (e) {e = 10}
33 | 'no-extra-boolean-cast': 'error', // запрет лишних логических приведений типов — let foo = !!!bar;
34 | 'no-extra-semi': 'error', // запрет лишних точек с запятой — let x = 5;;
35 | 'no-fallthrough': 'error', // запрет switch case без break и без комментария «fall through»
36 | 'no-func-assign': 'error', // запрет переназначения объявления function
37 | 'no-global-assign': 'error', // запрет переназначения глобальных переменных — window = {}
38 | 'no-import-assign': 'error', // запрет переназначения импорта — import test from …; test = 1
39 | 'no-inner-declarations': 'error', // запрет объявления функций и переменных внутри блоков кода
40 | 'no-invalid-regexp': 'error', // запрет недопустимых строк регулярных выражений в RegExp()
41 | 'no-irregular-whitespace': 'error', // запрет неправильных пробельных символов
42 | 'no-loss-of-precision': 'error', // запрет больших чисел, которые теряют точность
43 | 'no-misleading-character-class': 'error', // запрет проблемных регулярных выражений - /^[👍]$/
44 | 'no-mixed-spaces-and-tabs': 'error', // запрет смешанных отступов из пробелов и табуляций
45 | 'no-new-symbol': 'error', // запрет new Symbol()
46 | 'no-nonoctal-decimal-escape': 'error', // запрет \8 и \9 в строковых литералах
47 | 'no-obj-calls': 'error', // запрет вызова свойств глобального объекта как функций — let math = new Math();
48 | 'no-octal': 'error', // запрет восьмеричных литералов — num = 071
49 | 'no-prototype-builtins': 'error', // запрет вызова некоторых методов прототипа в объекте
50 | 'no-redeclare': 'error', // запрет повторного объявления переменной
51 | 'no-regex-spaces': 'error', // запрет использования нескольких пробелов в RegExp
52 | 'no-self-assign': 'error', // запрет присваивания переменной самой себя — y = y
53 | 'no-setter-return': 'error', // // запрет на return в setter класса
54 | 'no-shadow-restricted-names': 'error', // запрет имен переменных и функций как NaN, undefined и т.д.
55 | 'no-sparse-arrays': 'error', // запрет массивов с несколькими запятыми или без значений (с запятой) - items = [,];
56 | 'no-this-before-super': 'error', // запрет в конструкторе использовать this до вызова super()
57 | 'no-undef': 'error', // запрет на использование необъявленных переменных
58 | 'no-unexpected-multiline': 'error', // запрет запутанных многострочных выражений
59 | 'no-unreachable': 'error', // запрет недостижимого кода после return, throw, continue и break
60 | 'no-unsafe-finally': 'error', // запрет return, throw, break и continue внутри блока finally
61 | 'no-unsafe-negation': 'error', // запрет отрицания левого операнда в операторах отношения
62 | // if (!obj instanceof A) {
63 | // operator precedence makes it equivalent to (!obj) instanceof A
64 | // and it equivalent to always false since boolean values are not objects.
65 | // }
66 | 'no-unsafe-optional-chaining': 'error', // запрет использования foo?.bar в некоторых ситуациях
67 | 'no-unused-labels': 'error', // запрет неиспользуемых меток для цикла for
68 | 'no-unused-vars': 'error', // запрет неиспользуемых переменных
69 | 'no-useless-backreference': 'error', // запрет бесполезных обратных ссылок в RegExp
70 | 'no-useless-catch': 'error', // запрет ненужных catch
71 | 'no-useless-escape': 'error', // запрет ненужных escape-символов
72 | 'no-with': 'error', // запрет использования with
73 | // with (point) {
74 | // r = Math.sqrt(x * x + y * y); // is r a member of point?
75 | // }
76 | 'require-yield': 'error', // требовать yield для функции-генератора
77 | 'use-isnan': 'error', // обязательное использование isNaN() для проверки NaN
78 | 'valid-typeof': 'error', // требовать для typeof допустимых строк, таких как "string", "undefined", "object"
79 | };
--------------------------------------------------------------------------------