Merge pull request #1 from e7f3/fixes/configs-tweaks

Правки в инструменты сборки и конфиги линтеров
This commit is contained in:
Ilia Mashkov
2025-11-19 19:08:01 +03:00
committed by GitHub
6 changed files with 210 additions and 190 deletions

View File

@@ -63,6 +63,7 @@ export function buildPlugins({
plugins.push( plugins.push(
new BundleAnalyzerPlugin({ new BundleAnalyzerPlugin({
openAnalyzer: false, openAnalyzer: false,
analyzerMode: 'static',
}) })
) )
plugins.push(new ReactRefreshWebpackPlugin({ overlay: false })) plugins.push(new ReactRefreshWebpackPlugin({ overlay: false }))

View File

@@ -31,6 +31,8 @@ export function buildResolvers(options: BuildOptions): webpack.ResolveOptions {
preferAbsolute: true, preferAbsolute: true,
modules: [options.paths.src, 'node_modules'], modules: [options.paths.src, 'node_modules'],
mainFiles: ['index'], mainFiles: ['index'],
alias: {}, alias: {
'@': options.paths.src,
},
} }
} }

View File

@@ -18,7 +18,7 @@ import MiniCssExtractPlugin from 'mini-css-extract-plugin'
*/ */
export const buildCssLoader = (isDev: boolean) => { export const buildCssLoader = (isDev: boolean) => {
const cssLoader = { const cssLoader = {
test: /\.s[ac]ss$/i, test: /\.(s[ac]ss|css)$/i,
use: [ use: [
// Создает <style> теги из JS строк (dev) или извлекает в файлы (prod) // Создает <style> теги из JS строк (dev) или извлекает в файлы (prod)
isDev ? 'style-loader' : MiniCssExtractPlugin.loader, isDev ? 'style-loader' : MiniCssExtractPlugin.loader,
@@ -28,6 +28,7 @@ export const buildCssLoader = (isDev: boolean) => {
options: { options: {
modules: { modules: {
auto: /\.module\..*$/, auto: /\.module\..*$/,
namedExport: false,
localIdentName: isDev localIdentName: isDev
? '[path][name]__[local]--[hash:base64:5]' ? '[path][name]__[local]--[hash:base64:5]'
: '[hash:base64:8]', : '[hash:base64:8]',

View File

@@ -116,6 +116,7 @@ export default [
'internal', 'internal',
['sibling', 'parent'], ['sibling', 'parent'],
'index', 'index',
'type',
], ],
pathGroups: [ pathGroups: [
{ {
@@ -124,12 +125,13 @@ export default [
position: 'before', position: 'before',
}, },
{ {
pattern: '@src/**', pattern: '@/**',
group: 'internal', group: 'internal',
}, },
], ],
pathGroupsExcludedImportTypes: ['internal', 'react'], pathGroupsExcludedImportTypes: ['type'],
'newlines-between': 'always', 'newlines-between': 'always',
distinctGroup: false,
alphabetize: { alphabetize: {
order: 'asc', order: 'asc',
caseInsensitive: true, caseInsensitive: true,
@@ -189,7 +191,17 @@ export default [
'@typescript-eslint/no-unused-vars': 'warn', '@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-var-requires': 'warn', '@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-use-before-define': ['error', { enums: false }], '@typescript-eslint/no-use-before-define': ['error', { enums: false }],
'@typescript-eslint/naming-convention': 'warn', '@typescript-eslint/naming-convention': [
'warn',
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
},
],
'@typescript-eslint/ban-ts-comment': 'warn', '@typescript-eslint/ban-ts-comment': 'warn',
/** /**

View File

@@ -52,5 +52,6 @@ module.exports = {
'order/order': selectorOrdering, 'order/order': selectorOrdering,
'order/properties-order': propertyOrdering, 'order/properties-order': propertyOrdering,
'declaration-empty-line-before': null, 'declaration-empty-line-before': null,
'no-descending-specificity': null, // Отключаем из-за конфликта с order/order
}, },
} }

View File

@@ -11,6 +11,9 @@
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": [
"./src/*"
],
"*": [ "*": [
"./src/*" "./src/*"
] ]