Compare commits
43 Commits
@advdomini
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
70b66b7ec0
|
|||
|
034b93a2d6
|
|||
|
f2170575fb
|
|||
|
1c32452e60
|
|||
|
2e18f11fcf
|
|||
|
17378965fd
|
|||
|
14d13915c9
|
|||
|
369595c2de
|
|||
|
49ce40cd7f
|
|||
|
1a8f77622b
|
|||
|
8cf1ddbaf5
|
|||
|
8f2cae3401
|
|||
|
a0074442ae
|
|||
|
791c160125
|
|||
|
095724c175
|
|||
|
f30793af80
|
|||
|
3605551f16
|
|||
|
f8d793195c
|
|||
|
a655e7b5e4
|
|||
|
fc11cdfa48
|
|||
|
650008ad76
|
|||
|
96ae522a8f
|
|||
|
9dc95dd47a
|
|||
|
bce960599a
|
|||
|
6f24952680
|
|||
|
e1756bd60f
|
|||
|
ea33198344
|
|||
|
ca88f622d1
|
|||
|
9131e220d2
|
|||
|
4012b982a6
|
|||
|
d6aec9ed14
|
|||
|
e8a3ea043f
|
|||
|
cc8d0b7ab3
|
|||
|
dfb04760f1
|
|||
|
db9022c00b
|
|||
|
00c079c029
|
|||
|
53dc2d3092
|
|||
|
|
9ac5f6bd28 | ||
|
|
09f069b727 | ||
|
|
f9dc305aae | ||
|
|
7d56c06702 | ||
|
|
0bb60a0e0a | ||
|
|
205ea19086 |
@@ -6,3 +6,6 @@ indent_size = 4
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{json,yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -14,17 +14,14 @@ node_modules
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
|
||||
# ESLint
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Stylelint
|
||||
|
||||
.stylelintcache
|
||||
|
||||
# Composer
|
||||
# https://github.com/github/gitignore/blob/main/Composer.gitignore
|
||||
|
||||
vendor
|
||||
composer.phar
|
||||
/vendor/
|
||||
|
||||
# https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
|
||||
|
||||
|
||||
1
.husky/pre-commit
Executable file
1
.husky/pre-commit
Executable file
@@ -0,0 +1 @@
|
||||
yarn lint-staged
|
||||
8
.oxfmtrc.json
Normal file
8
.oxfmtrc.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"printWidth": 120,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "consistent",
|
||||
"sortImports": true,
|
||||
"sortPackageJson": false,
|
||||
"ignorePatterns": [".docker", ".yarn", "html"]
|
||||
}
|
||||
97
.oxlintrc.json
Normal file
97
.oxlintrc.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"plugins": ["eslint", "unicorn", "oxc", "vue"],
|
||||
"categories": {
|
||||
"correctness": "error",
|
||||
"suspicious": "warn",
|
||||
"pedantic": "warn",
|
||||
"perf": "warn",
|
||||
"style": "warn",
|
||||
"restriction": "warn",
|
||||
"nursery": "off"
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"builtin": true
|
||||
},
|
||||
"rules": {
|
||||
"eslint/capitalized-comments": "off",
|
||||
"eslint/complexity": "off",
|
||||
"eslint/id-length": "off",
|
||||
"eslint/init-declarations": "off",
|
||||
"eslint/max-depth": "off",
|
||||
"eslint/max-lines": "off",
|
||||
"eslint/max-lines-per-function": "off",
|
||||
"eslint/max-statements": "off",
|
||||
"eslint/no-console": ["warn", { "allow": ["info", "warn", "error"] }],
|
||||
"eslint/no-inline-comments": "off",
|
||||
"eslint/no-irregular-whitespace": ["error", { "skipTemplates": true }],
|
||||
"eslint/no-magic-numbers": "off",
|
||||
"eslint/no-new": "off",
|
||||
"eslint/no-shadow": "off",
|
||||
"eslint/no-ternary": "off",
|
||||
"eslint/no-throw-literal": "off",
|
||||
"eslint/no-undefined": "off",
|
||||
"eslint/no-underscore-dangle": "off",
|
||||
"eslint/no-unexpected-multiline": "off",
|
||||
"eslint/prefer-destructuring": [
|
||||
"warn",
|
||||
{
|
||||
"AssignmentExpression": {
|
||||
"array": false,
|
||||
"object": false
|
||||
},
|
||||
"VariableDeclarator": {
|
||||
"array": false,
|
||||
"object": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"eslint/prefer-named-capture-group": "off",
|
||||
"eslint/radix": "off",
|
||||
"eslint/require-unicode-regexp": "off",
|
||||
"eslint/sort-imports": "off",
|
||||
"eslint/sort-keys": "off",
|
||||
"oxc/no-async-await": "off",
|
||||
"oxc/no-map-spread": "off",
|
||||
"oxc/no-optional-chaining": "off",
|
||||
"oxc/no-rest-spread-properties": "off",
|
||||
"unicorn/filename-case": ["warn", { "cases": { "kebabCase": true, "pascalCase": true } }],
|
||||
"unicorn/no-empty-file": "warn",
|
||||
"unicorn/no-nested-ternary": "off",
|
||||
"unicorn/no-useless-switch-case": "off",
|
||||
"unicorn/prefer-global-this": "off",
|
||||
"vue/define-props-destructuring": "off",
|
||||
"vue/max-props": "off"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["build-scripts/*.js"],
|
||||
"rules": {
|
||||
"eslint/no-console": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["src/scripts/mocks/**/*.js"],
|
||||
"rules": {
|
||||
"eslint/no-console": "off",
|
||||
"unicorn/prefer-ternary": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["src/scripts/blocks/**/*.js"],
|
||||
"rules": {
|
||||
"unicorn/prefer-top-level-await": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["src/scripts/composables/*.js"],
|
||||
"rules": {
|
||||
"unicorn/filename-case": ["warn", { "cases": { "camelCase": true } }]
|
||||
}
|
||||
}
|
||||
],
|
||||
"ignorePatterns": [".yarn"],
|
||||
"options": {
|
||||
"maxWarnings": 10
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
.vscode
|
||||
.yarn
|
||||
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"arcanis.vscode-zipfs",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"search.exclude": {
|
||||
"**/.yarn": true,
|
||||
"**/.pnp.*": true
|
||||
},
|
||||
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs"
|
||||
}
|
||||
893
.yarn/releases/yarn-4.1.1.cjs
vendored
893
.yarn/releases/yarn-4.1.1.cjs
vendored
File diff suppressed because one or more lines are too long
944
.yarn/releases/yarn-4.17.0.cjs
vendored
Executable file
944
.yarn/releases/yarn-4.17.0.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
2
.yarn/sdks/integrations.yml
vendored
2
.yarn/sdks/integrations.yml
vendored
@@ -1,5 +1,3 @@
|
||||
# This file is automatically generated by @yarnpkg/sdks.
|
||||
# Manual changes might be lost!
|
||||
|
||||
integrations:
|
||||
- vscode
|
||||
|
||||
51
.yarn/sdks/oxfmt/bin/oxfmt
vendored
Executable file
51
.yarn/sdks/oxfmt/bin/oxfmt
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxfmt
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof global[`__yarnpkg_sdk_has_setup_env__`] === `undefined`) {
|
||||
Object.defineProperty(global, `__yarnpkg_sdk_has_setup_env__`, {configurable: true, value: true});
|
||||
|
||||
process.env.NODE_OPTIONS = process.env.NODE_OPTIONS || ``;
|
||||
process.env.NODE_OPTIONS += ` -r ${absPnpApiPath}`;
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
process.env.NODE_OPTIONS += ` --experimental-loader ${pathToFileURL(absPnpLoaderPath)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
const moduleWrapper = exports => {
|
||||
return wrapWithUserWrapper(moduleWrapperFn(exports));
|
||||
};
|
||||
|
||||
const moduleWrapperFn = module => module;
|
||||
|
||||
const binPath = resolve(absRequire.resolve(`oxfmt/package.json`), `..`, `bin/oxfmt`);
|
||||
absRequire(binPath);
|
||||
|
||||
// Defer to the real oxfmt your application uses
|
||||
module.exports = moduleWrapper(absRequire(`oxfmt`));
|
||||
32
.yarn/sdks/oxfmt/dist/index.d.ts
vendored
Normal file
32
.yarn/sdks/oxfmt/dist/index.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxfmt
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real oxfmt your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxfmt`));
|
||||
32
.yarn/sdks/oxfmt/dist/index.js
vendored
Normal file
32
.yarn/sdks/oxfmt/dist/index.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxfmt
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real oxfmt your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxfmt`));
|
||||
16
.yarn/sdks/oxfmt/package.json
vendored
Normal file
16
.yarn/sdks/oxfmt/package.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "oxfmt",
|
||||
"version": "0.55.0-sdk",
|
||||
"main": "dist/index.js",
|
||||
"type": "commonjs",
|
||||
"bin": {
|
||||
"oxfmt": "bin/oxfmt"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
}
|
||||
}
|
||||
43
.yarn/sdks/oxlint/bin/oxlint
vendored
Executable file
43
.yarn/sdks/oxlint/bin/oxlint
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxlint
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
const moduleWrapper = exports => {
|
||||
return wrapWithUserWrapper(moduleWrapperFn(exports));
|
||||
};
|
||||
|
||||
const moduleWrapperFn = module => module;
|
||||
|
||||
process.env.PATH += `;${resolve(__dirname, `../../oxlint-tsgolint/bin`)}`;
|
||||
|
||||
const binPath = resolve(absRequire.resolve(`oxlint/package.json`), `..`, `bin/oxlint`);
|
||||
import(pathToFileURL(binPath));
|
||||
|
||||
// Defer to the real oxlint your application uses
|
||||
module.exports = moduleWrapper(absRequire(`oxlint`));
|
||||
32
.yarn/sdks/oxlint/dist/index.d.ts
vendored
Normal file
32
.yarn/sdks/oxlint/dist/index.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxlint
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real oxlint your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxlint`));
|
||||
32
.yarn/sdks/oxlint/dist/index.js
vendored
Normal file
32
.yarn/sdks/oxlint/dist/index.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxlint
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real oxlint your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxlint`));
|
||||
32
.yarn/sdks/oxlint/dist/plugins-dev.d.ts
vendored
Normal file
32
.yarn/sdks/oxlint/dist/plugins-dev.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxlint/plugins-dev
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real oxlint/plugins-dev your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxlint/plugins-dev`));
|
||||
32
.yarn/sdks/oxlint/dist/plugins-dev.js
vendored
Normal file
32
.yarn/sdks/oxlint/dist/plugins-dev.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire, register} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
const {pathToFileURL} = require(`url`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require oxlint/plugins-dev
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real oxlint/plugins-dev your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxlint/plugins-dev`));
|
||||
20
.yarn/sdks/oxlint/package.json
vendored
Normal file
20
.yarn/sdks/oxlint/package.json
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "oxlint",
|
||||
"version": "1.70.0-sdk",
|
||||
"main": "dist/index.js",
|
||||
"type": "commonjs",
|
||||
"bin": {
|
||||
"oxlint": "bin/oxlint"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"./plugins-dev": {
|
||||
"types": "./dist/plugins-dev.d.ts",
|
||||
"default": "./dist/plugins-dev.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
}
|
||||
}
|
||||
20
.yarn/sdks/prettier/bin/prettier.cjs
vendored
20
.yarn/sdks/prettier/bin/prettier.cjs
vendored
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require prettier/bin/prettier.cjs
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real prettier/bin/prettier.cjs your application uses
|
||||
module.exports = absRequire(`prettier/bin/prettier.cjs`);
|
||||
20
.yarn/sdks/prettier/index.cjs
vendored
20
.yarn/sdks/prettier/index.cjs
vendored
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require prettier
|
||||
require(absPnpApiPath).setup();
|
||||
}
|
||||
}
|
||||
|
||||
// Defer to the real prettier your application uses
|
||||
module.exports = absRequire(`prettier`);
|
||||
7
.yarn/sdks/prettier/package.json
vendored
7
.yarn/sdks/prettier/package.json
vendored
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "prettier",
|
||||
"version": "3.2.5-sdk",
|
||||
"main": "./index.cjs",
|
||||
"type": "commonjs",
|
||||
"bin": "./bin/prettier.cjs"
|
||||
}
|
||||
12
.yarnrc.yml
12
.yarnrc.yml
@@ -1 +1,11 @@
|
||||
yarnPath: .yarn/releases/yarn-4.1.1.cjs
|
||||
enableGlobalCache: false
|
||||
|
||||
packageExtensions:
|
||||
'lerna@*':
|
||||
dependencies:
|
||||
ci-info: '*'
|
||||
'@advdominion/stylelint-config@*':
|
||||
dependencies:
|
||||
stylelint: '*'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.17.0.cjs
|
||||
|
||||
27
README.md
Normal file
27
README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# frontend
|
||||
|
||||
## Добавление нового пакета
|
||||
|
||||
1. Скопировать один из существующих пакетов в папке `packages`
|
||||
2. На его основе подготовить новый пакет
|
||||
3. Запустить `yarn`
|
||||
|
||||
## Публикация новых версий
|
||||
|
||||
```bash
|
||||
yarn lerna publish
|
||||
```
|
||||
|
||||
## Обновление зависимостей
|
||||
|
||||
```bash
|
||||
yarn set version stable
|
||||
|
||||
yarn upgrade-interactive
|
||||
|
||||
yarn dedupe
|
||||
|
||||
yarn dlx @yarnpkg/sdks base
|
||||
|
||||
yarn install
|
||||
```
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||
"version": "independent",
|
||||
"npmClient": "yarn"
|
||||
}
|
||||
|
||||
7
lint-staged.config.js
Normal file
7
lint-staged.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export default {
|
||||
'*.js': (filenames) => [
|
||||
`oxlint --max-warnings 10 --fix ${filenames.join(' ')}`,
|
||||
`oxfmt --write ${filenames.join(' ')}`,
|
||||
],
|
||||
'*.{json,md,yml}': (filenames) => [`oxfmt --write ${filenames.join(' ')}`],
|
||||
};
|
||||
15
package.json
15
package.json
@@ -1,13 +1,18 @@
|
||||
{
|
||||
"name": "root",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"packageManager": "yarn@4.17.0",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"devDependencies": {
|
||||
"lerna": "^8.1.2",
|
||||
"prettier": "^3.2.5"
|
||||
"scripts": {
|
||||
"postinstall": "husky"
|
||||
},
|
||||
"packageManager": "yarn@4.1.1"
|
||||
"devDependencies": {
|
||||
"husky": "^9.1.7",
|
||||
"lerna": "^9.0.7",
|
||||
"lint-staged": "^17.0.7",
|
||||
"oxfmt": "^0.55.0",
|
||||
"oxlint": "^1.70.0"
|
||||
}
|
||||
}
|
||||
|
||||
70
packages/babel-plugin-nunjucks/README.md
Normal file
70
packages/babel-plugin-nunjucks/README.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# babel-plugin-nunjucks
|
||||
|
||||
Плагин для [babel-loader](https://github.com/babel/babel-loader), позволяющий использовать шаблонизатор [Nunjucks](https://mozilla.github.io/nunjucks/) внутри JS-файлов.
|
||||
|
||||
## Установка
|
||||
|
||||
```bash
|
||||
yarn add -D @advdominion/babel-plugin-nunjucks
|
||||
```
|
||||
|
||||
## Использование
|
||||
|
||||
Используются [Tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) с тегом `njk`:
|
||||
|
||||
```js
|
||||
njk`
|
||||
{% from "./item.njk" import item as item %}
|
||||
|
||||
<div class="items">
|
||||
{% for n in range(0, 10) %}
|
||||
{{item()}}
|
||||
{% endfor %}
|
||||
</div>
|
||||
`;
|
||||
```
|
||||
|
||||
Пример конфигурации Webpack:
|
||||
|
||||
```js
|
||||
[
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: [/mocks\.js$/],
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
cacheDirectory: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /mocks\.js$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
compact: false,
|
||||
plugins: [
|
||||
[
|
||||
'@advdominion/babel-plugin-nunjucks',
|
||||
{
|
||||
templatesFolder: 'src/templates/',
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
## Опции
|
||||
|
||||
- `templatesFolder` - строка, обязательный параметр. Путь до папки с файлами шаблонов
|
||||
- `globals` - массив, необязательный параметр. Глобальные переменные для Nunjucks (например, `[{name: "message", value: "Hello, world!"}]`)
|
||||
|
||||
**Важно:** Параметр `cacheDirectory` в опциях babel-loader должен быть отключён.
|
||||
25
packages/babel-plugin-nunjucks/index.js
Normal file
25
packages/babel-plugin-nunjucks/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import nunjucks from 'nunjucks';
|
||||
|
||||
const babelPluginNunjucks = ({ types: t }) => {
|
||||
return {
|
||||
pre(state) {
|
||||
const options = state.opts.plugins[0].options;
|
||||
this.njkenv = new nunjucks.Environment(new nunjucks.FileSystemLoader(options.templatesFolder));
|
||||
if (options.globals) {
|
||||
for (const { name, value } of options.globals) {
|
||||
this.njkenv.addGlobal(name, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
visitor: {
|
||||
TaggedTemplateExpression(path) {
|
||||
if (path.get('tag').isIdentifier({ name: 'njk' })) {
|
||||
const render = this.njkenv.renderString(path.node.quasi.quasis[0].value.raw);
|
||||
path.replaceWith(t.stringLiteral(render));
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default babelPluginNunjucks;
|
||||
18
packages/babel-plugin-nunjucks/package.json
Normal file
18
packages/babel-plugin-nunjucks/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "@advdominion/babel-plugin-nunjucks",
|
||||
"version": "3.1.1",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"nunjucks": "^3.0.0"
|
||||
}
|
||||
}
|
||||
25
packages/css-var/README.md
Normal file
25
packages/css-var/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# css-var
|
||||
|
||||
Получение значений CSS-переменных в JS
|
||||
|
||||
## Использование
|
||||
|
||||
```css
|
||||
:root {
|
||||
--z-index: 100;
|
||||
--height: 100px;
|
||||
--duration-ms: 100ms;
|
||||
--duration-s: 100s;
|
||||
--easing: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
import { cssVar } from '@advdominion/css-var';
|
||||
|
||||
cssVar('--z-index'); // '1' (String)
|
||||
cssVar('--height'); // '100px' (String)
|
||||
cssVar('--duration-ms'); // 100 (Number)
|
||||
cssVar('--duration-s'); // 100 (Number)
|
||||
cssVar('--easing'); // cubic-bezier(0.4, 0, 0.2, 1) (String)
|
||||
```
|
||||
9
packages/css-var/index.js
Normal file
9
packages/css-var/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
export const cssVar = (name, element = document.documentElement) => {
|
||||
const value = window.getComputedStyle(element).getPropertyValue(name);
|
||||
const durationRegExp = /(^[\d.]+)(ms|s)$/;
|
||||
if (durationRegExp.test(value)) {
|
||||
const [, numericValue, unit] = durationRegExp.exec(value);
|
||||
return unit === 's' ? numericValue * 1000 : Number(numericValue);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
14
packages/css-var/package.json
Normal file
14
packages/css-var/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@advdominion/css-var",
|
||||
"version": "1.0.1",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@advdominion/get-scrollbar-width",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/helpers.git"
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# is
|
||||
|
||||
Check variable type
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { is } from '@advdominion/is';
|
||||
|
||||
console.log(is('Hello, world!', 'String'));
|
||||
```
|
||||
@@ -1,3 +0,0 @@
|
||||
export const is = (obj, type) => {
|
||||
return Object.prototype.toString.call(obj).slice(8, -1) === type && obj !== undefined && obj !== null;
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "@advdominion/is",
|
||||
"version": "1.0.1",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/helpers.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
53
packages/lightningcss-loader/README.md
Normal file
53
packages/lightningcss-loader/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# lightningcss-loader
|
||||
|
||||
[Lightning CSS](https://lightningcss.dev) loader for [Webpack](https://webpack.js.org)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { transform } from 'lightningcss';
|
||||
|
||||
return {
|
||||
...,
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
{
|
||||
loader: '@advdominion/lightningcss-loader',
|
||||
options: {
|
||||
implementation: transform,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Passing options to Lightning CSS
|
||||
|
||||
```js
|
||||
import { transform } from 'lightningcss';
|
||||
|
||||
return {
|
||||
...,
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
{
|
||||
loader: '@advdominion/lightningcss-loader',
|
||||
options: {
|
||||
implementation: transform,
|
||||
drafts: {
|
||||
customMedia: true,
|
||||
},
|
||||
minify: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
22
packages/lightningcss-loader/index.js
Normal file
22
packages/lightningcss-loader/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const lightningcssLoader = function (source, sourceMap) {
|
||||
const { implementation, ...options } = this.getOptions();
|
||||
const callback = this.async();
|
||||
|
||||
if (typeof implementation !== 'function') {
|
||||
throw new TypeError(
|
||||
`[lightningcss-loader]: The "implementation" option is required and must provide "transform" function of the LightningCSS`,
|
||||
);
|
||||
}
|
||||
|
||||
const { code, map } = implementation({
|
||||
filename: this.resourcePath,
|
||||
code: Buffer.from(source),
|
||||
sourceMap: this.sourceMap,
|
||||
inputSourceMap: this.sourceMap && sourceMap ? JSON.stringify(sourceMap) : undefined,
|
||||
...options,
|
||||
});
|
||||
|
||||
callback(undefined, code.toString(), map && JSON.parse(map.toString()));
|
||||
};
|
||||
|
||||
export default lightningcssLoader;
|
||||
14
packages/lightningcss-loader/package.json
Normal file
14
packages/lightningcss-loader/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@advdominion/lightningcss-loader",
|
||||
"version": "1.0.2",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
11
packages/pluralize/README.md
Normal file
11
packages/pluralize/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# pluralize
|
||||
|
||||
Склонение существительных в зависимости от числа
|
||||
|
||||
## Использование
|
||||
|
||||
```js
|
||||
import { pluralize } from '@advdominion/pluralize';
|
||||
|
||||
console.log(pluralize(1, ['яблоко', 'яблока', 'яблок']));
|
||||
```
|
||||
14
packages/pluralize/index.js
Normal file
14
packages/pluralize/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export const pluralize = (count, words) => {
|
||||
const normalizedCount = Math.abs(count) % 100;
|
||||
const count10 = normalizedCount % 10;
|
||||
if (normalizedCount > 10 && normalizedCount < 20) {
|
||||
return words[2];
|
||||
}
|
||||
if (count10 > 1 && count10 < 5) {
|
||||
return words[1];
|
||||
}
|
||||
if (count10 === 1) {
|
||||
return words[0];
|
||||
}
|
||||
return words[2];
|
||||
};
|
||||
14
packages/pluralize/package.json
Normal file
14
packages/pluralize/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@advdominion/pluralize",
|
||||
"version": "1.0.2",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
33
packages/scroll-to/README.md
Normal file
33
packages/scroll-to/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# scroll-to
|
||||
|
||||
Плавный скролл до элемента с поддержкой нативного события `scrollend` и гибкой настройкой отступов.
|
||||
|
||||
## Использование
|
||||
|
||||
```js
|
||||
import { scrollTo } from '@advdominion/scroll-to';
|
||||
|
||||
// Базовый скролл до элемента
|
||||
await scrollTo(document.querySelector('#example'));
|
||||
|
||||
// Скролл с отступом 100px (например, для фиксированной шапки)
|
||||
await scrollTo(document.querySelector('#example'), 100, true);
|
||||
|
||||
// Скролл с отступом в 10% от высоты экрана
|
||||
await scrollTo(document.querySelector('#example'), 10);
|
||||
```
|
||||
|
||||
## Параметры
|
||||
|
||||
| Параметр | Тип | По умолчанию | Описание |
|
||||
| :------------- | :------------ | :----------- | :------------------------------------------------------------------------- |
|
||||
| **$el** | `HTMLElement` | — | DOM-элемент, к которому нужно прокрутить страницу |
|
||||
| **offset** | `number` | `0` | Величина отступа сверху от целевого элемента |
|
||||
| **offsetInPx** | `boolean` | `false` | Тип отступа: `true` — в пикселях, `false` — в процентах от высоты вьюпорта |
|
||||
|
||||
## Как это работает
|
||||
|
||||
1. **Точность:** Использует нативное событие `scrollend`, которое срабатывает строго после завершения анимации прокрутки.
|
||||
2. **Безопасность:** Если браузер не поддерживает `scrollend` или анимация прервана, сработает автоматический fallback через 1500 мс.
|
||||
3. **Плавность:** Использует нативный `behavior: 'smooth'`.
|
||||
4. **Очистка данных:** Автоматически удаляет слушатели событий и таймеры после завершения или отмены скролла.
|
||||
40
packages/scroll-to/index.js
Normal file
40
packages/scroll-to/index.js
Normal file
@@ -0,0 +1,40 @@
|
||||
export const scrollTo = ($el, offset = 0, offsetInPx = false) => {
|
||||
return new Promise((resolve) => {
|
||||
if (!$el) {
|
||||
console.warn('Элемент не найден');
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const elementPosition = $el.getBoundingClientRect().top + window.scrollY;
|
||||
const topOffset = offsetInPx ? offset : (window.innerHeight * offset) / 100;
|
||||
const targetScrollTop = elementPosition - topOffset;
|
||||
|
||||
// Если элемент уже в нужной позиции
|
||||
if (Math.abs(window.scrollY - targetScrollTop) < 1) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
let resolved = false; // На случай, если scrollend и fallback запустятся одновременно
|
||||
let fallbackTimeout; // eslint-disable-line prefer-const
|
||||
|
||||
const done = () => {
|
||||
if (resolved) return;
|
||||
resolved = true;
|
||||
|
||||
window.removeEventListener('scrollend', done);
|
||||
clearTimeout(fallbackTimeout);
|
||||
|
||||
resolve();
|
||||
};
|
||||
|
||||
window.addEventListener('scrollend', done, { once: true });
|
||||
fallbackTimeout = setTimeout(done, 1500);
|
||||
|
||||
window.scrollTo({
|
||||
top: targetScrollTop,
|
||||
behavior: 'smooth',
|
||||
});
|
||||
});
|
||||
};
|
||||
14
packages/scroll-to/package.json
Normal file
14
packages/scroll-to/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@advdominion/scroll-to",
|
||||
"version": "1.0.1",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
22
packages/stylelint-config/README.md
Normal file
22
packages/stylelint-config/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Конфигурация для Stylelint
|
||||
|
||||
Включает в себя:
|
||||
|
||||
- [stylelint-config-standard-scss](https://github.com/stylelint-scss/stylelint-config-standard-scss)
|
||||
- [stylelint-order](https://github.com/hudochenkov/stylelint-order)
|
||||
- Проверку кода тега `<style>` в файлах `.vue`
|
||||
|
||||
## Использование
|
||||
|
||||
### Требования
|
||||
|
||||
- [Stylelint](https://stylelint.io/) ^10.0.0
|
||||
|
||||
### Подключание
|
||||
|
||||
```js
|
||||
export default {
|
||||
extends: ['@advdominion/stylelint-config'],
|
||||
// Дополнительная конфигурация проекта
|
||||
};
|
||||
```
|
||||
55
packages/stylelint-config/index.js
Normal file
55
packages/stylelint-config/index.js
Normal file
@@ -0,0 +1,55 @@
|
||||
/* eslint-disable unicorn/no-null */
|
||||
|
||||
export default {
|
||||
extends: ['stylelint-config-standard-scss'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.vue'],
|
||||
customSyntax: 'postcss-html',
|
||||
},
|
||||
],
|
||||
plugins: ['stylelint-order'],
|
||||
rules: {
|
||||
'block-no-empty': null,
|
||||
'no-invalid-double-slash-comments': null,
|
||||
'no-invalid-position-declaration': [true, { ignoreAtRules: ['media'] }],
|
||||
'property-disallowed-list': [
|
||||
'animation',
|
||||
'background',
|
||||
'border',
|
||||
'flex',
|
||||
'font',
|
||||
'grid',
|
||||
'margin',
|
||||
'padding',
|
||||
'transition',
|
||||
],
|
||||
'color-hex-length': 'long',
|
||||
'font-weight-notation': 'named-where-possible',
|
||||
'container-name-pattern': null,
|
||||
'custom-media-pattern': null,
|
||||
'custom-property-pattern': null,
|
||||
'keyframes-name-pattern': null,
|
||||
'layer-name-pattern': null,
|
||||
'selector-class-pattern': null,
|
||||
'selector-id-pattern': null,
|
||||
'declaration-block-no-redundant-longhand-properties': null,
|
||||
'scss/double-slash-comment-empty-line-before': null,
|
||||
'order/order': [
|
||||
{
|
||||
type: 'at-rule',
|
||||
name: 'use',
|
||||
},
|
||||
'dollar-variables',
|
||||
'custom-properties',
|
||||
'declarations',
|
||||
{
|
||||
type: 'at-rule',
|
||||
name: 'include',
|
||||
},
|
||||
'at-rules',
|
||||
'rules',
|
||||
],
|
||||
'order/properties-alphabetical-order': true,
|
||||
},
|
||||
};
|
||||
23
packages/stylelint-config/package.json
Normal file
23
packages/stylelint-config/package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@advdominion/stylelint-config",
|
||||
"version": "1.1.0",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"postcss": "^8.5.6",
|
||||
"postcss-html": "^1.8.1",
|
||||
"stylelint-config-standard-scss": "^17.0.0",
|
||||
"stylelint-order": "^7.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"stylelint": "^17.0.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
export default {
|
||||
printWidth: 120,
|
||||
tabWidth: 4,
|
||||
singleQuote: true,
|
||||
};
|
||||
Reference in New Issue
Block a user