Обновлены зависимости, ESLint/Prettier заменены на Oxlint/Oxfmt, удалены настройки для VS Code
This commit is contained in:
@@ -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
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -14,10 +14,6 @@ node_modules
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
|
||||
# ESLint
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Stylelint
|
||||
|
||||
.stylelintcache
|
||||
|
||||
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
|
||||
9
.vscode/extensions.json
vendored
9
.vscode/extensions.json
vendored
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"arcanis.vscode-zipfs",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"stylelint.vscode-stylelint"
|
||||
]
|
||||
}
|
||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"search.exclude": {
|
||||
"**/.yarn": true,
|
||||
"**/.pnp.*": true
|
||||
},
|
||||
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
|
||||
"eslint.nodePath": ".yarn/sdks"
|
||||
}
|
||||
942
.yarn/releases/yarn-4.12.0.cjs
vendored
942
.yarn/releases/yarn-4.12.0.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
32
.yarn/sdks/eslint/lib/types/config-api.d.ts
vendored
32
.yarn/sdks/eslint/lib/types/config-api.d.ts
vendored
@@ -1,32 +0,0 @@
|
||||
#!/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 eslint/config
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/config your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/config`));
|
||||
32
.yarn/sdks/eslint/lib/types/index.d.ts
vendored
32
.yarn/sdks/eslint/lib/types/index.d.ts
vendored
@@ -1,32 +0,0 @@
|
||||
#!/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 eslint
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
|
||||
32
.yarn/sdks/eslint/lib/types/rules.d.ts
vendored
32
.yarn/sdks/eslint/lib/types/rules.d.ts
vendored
@@ -1,32 +0,0 @@
|
||||
#!/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 eslint/rules
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/rules your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/rules`));
|
||||
32
.yarn/sdks/eslint/lib/types/universal.d.ts
vendored
32
.yarn/sdks/eslint/lib/types/universal.d.ts
vendored
@@ -1,32 +0,0 @@
|
||||
#!/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 eslint/universal
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/universal your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/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 eslint/use-at-your-own-risk
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/use-at-your-own-risk your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));
|
||||
32
.yarn/sdks/eslint/lib/unsupported-api.js
vendored
32
.yarn/sdks/eslint/lib/unsupported-api.js
vendored
@@ -1,32 +0,0 @@
|
||||
#!/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 eslint/use-at-your-own-risk
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/use-at-your-own-risk your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));
|
||||
31
.yarn/sdks/eslint/package.json
vendored
31
.yarn/sdks/eslint/package.json
vendored
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "eslint",
|
||||
"version": "10.0.0-sdk",
|
||||
"main": "./lib/api.js",
|
||||
"type": "commonjs",
|
||||
"bin": {
|
||||
"eslint": "./bin/eslint.js"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/types/index.d.ts",
|
||||
"default": "./lib/api.js"
|
||||
},
|
||||
"./config": {
|
||||
"types": "./lib/types/config-api.d.ts",
|
||||
"default": "./lib/config-api.js"
|
||||
},
|
||||
"./package.json": "./package.json",
|
||||
"./use-at-your-own-risk": {
|
||||
"types": "./lib/types/use-at-your-own-risk.d.ts",
|
||||
"default": "./lib/unsupported-api.js"
|
||||
},
|
||||
"./rules": {
|
||||
"types": "./lib/types/rules.d.ts"
|
||||
},
|
||||
"./universal": {
|
||||
"types": "./lib/types/universal.d.ts",
|
||||
"default": "./lib/universal.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
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`));
|
||||
@@ -16,7 +16,7 @@ const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require eslint
|
||||
// Setup the environment to be able to require oxfmt
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
@@ -28,5 +28,5 @@ const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
|
||||
// Defer to the real oxfmt your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxfmt`));
|
||||
@@ -16,7 +16,7 @@ const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require eslint/config
|
||||
// Setup the environment to be able to require oxfmt
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
@@ -28,5 +28,5 @@ const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/config your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/config`));
|
||||
// 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`));
|
||||
@@ -16,7 +16,7 @@ const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require eslint/universal
|
||||
// Setup the environment to be able to require oxlint
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
@@ -28,5 +28,5 @@ const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/universal your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));
|
||||
// Defer to the real oxlint your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`oxlint`));
|
||||
6
.yarn/sdks/eslint/bin/eslint.js → .yarn/sdks/oxlint/dist/index.js
vendored
Executable file → Normal file
6
.yarn/sdks/eslint/bin/eslint.js → .yarn/sdks/oxlint/dist/index.js
vendored
Executable file → Normal file
@@ -16,7 +16,7 @@ const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
// Setup the environment to be able to require eslint/bin/eslint.js
|
||||
// Setup the environment to be able to require oxlint
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
@@ -28,5 +28,5 @@ const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real eslint/bin/eslint.js your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));
|
||||
// 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"
|
||||
}
|
||||
}
|
||||
32
.yarn/sdks/prettier/bin/prettier.cjs
vendored
32
.yarn/sdks/prettier/bin/prettier.cjs
vendored
@@ -1,32 +0,0 @@
|
||||
#!/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 prettier/bin/prettier.cjs
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real prettier/bin/prettier.cjs your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`));
|
||||
32
.yarn/sdks/prettier/index.cjs
vendored
32
.yarn/sdks/prettier/index.cjs
vendored
@@ -1,32 +0,0 @@
|
||||
#!/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 prettier
|
||||
require(absPnpApiPath).setup();
|
||||
if (isPnpLoaderEnabled && register) {
|
||||
register(pathToFileURL(absPnpLoaderPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||
? exports => absRequire(absUserWrapperPath)(exports)
|
||||
: exports => exports;
|
||||
|
||||
// Defer to the real prettier your application uses
|
||||
module.exports = wrapWithUserWrapper(absRequire(`prettier`));
|
||||
7
.yarn/sdks/prettier/package.json
vendored
7
.yarn/sdks/prettier/package.json
vendored
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "prettier",
|
||||
"version": "3.8.1-sdk",
|
||||
"main": "./index.cjs",
|
||||
"type": "commonjs",
|
||||
"bin": "./bin/prettier.cjs"
|
||||
}
|
||||
@@ -4,11 +4,8 @@ packageExtensions:
|
||||
'lerna@*':
|
||||
dependencies:
|
||||
ci-info: '*'
|
||||
'@advdominion/eslint-config@*':
|
||||
dependencies:
|
||||
eslint: '*'
|
||||
'@advdominion/stylelint-config@*':
|
||||
dependencies:
|
||||
stylelint: '*'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.12.0.cjs
|
||||
yarnPath: .yarn/releases/yarn-4.17.0.cjs
|
||||
|
||||
@@ -17,9 +17,11 @@ yarn lerna publish
|
||||
```bash
|
||||
yarn set version stable
|
||||
|
||||
yarn install
|
||||
|
||||
yarn upgrade-interactive
|
||||
|
||||
yarn dlx @yarnpkg/sdks
|
||||
yarn dedupe
|
||||
|
||||
yarn dlx @yarnpkg/sdks base
|
||||
|
||||
yarn install
|
||||
```
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import config from '@advdominion/eslint-config';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
export default defineConfig([
|
||||
...config,
|
||||
{
|
||||
ignores: ['.yarn', '.pnp.*'],
|
||||
},
|
||||
]);
|
||||
@@ -1,8 +1,7 @@
|
||||
export default {
|
||||
'*.js': (filenames) => {
|
||||
return [`eslint --max-warnings 10 --fix ${filenames.join(' ')}`, `prettier --write ${filenames.join(' ')}`];
|
||||
},
|
||||
'*.{json,md,yml}': (filenames) => {
|
||||
return [`prettier --write ${filenames.join(' ')}`];
|
||||
},
|
||||
'*.js': (filenames) => [
|
||||
`oxlint --max-warnings 10 --fix ${filenames.join(' ')}`,
|
||||
`oxfmt --write ${filenames.join(' ')}`,
|
||||
],
|
||||
'*.{json,md,yml}': (filenames) => [`oxfmt --write ${filenames.join(' ')}`],
|
||||
};
|
||||
|
||||
11
package.json
11
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"packageManager": "yarn@4.12.0",
|
||||
"packageManager": "yarn@4.17.0",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -9,11 +9,10 @@
|
||||
"postinstall": "husky"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@advdominion/eslint-config": "workspace:*",
|
||||
"eslint": "^10.0.0",
|
||||
"husky": "^9.1.7",
|
||||
"lerna": "^9.0.4",
|
||||
"lint-staged": "^16.2.7",
|
||||
"prettier": "^3.8.1"
|
||||
"lerna": "^9.0.7",
|
||||
"lint-staged": "^17.0.7",
|
||||
"oxfmt": "^0.55.0",
|
||||
"oxlint": "^1.70.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
# Конфигурация для ESLint
|
||||
|
||||
Включает в себя:
|
||||
|
||||
- [js/recommended](https://eslint.org/docs/latest/use/configure/configuration-files#using-predefined-configurations) из ESLint
|
||||
- [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier)
|
||||
- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)
|
||||
- [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
||||
- [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue)
|
||||
- [globals](https://github.com/sindresorhus/globals) (`browser` и `nodeBuiltin`)
|
||||
|
||||
## Использование
|
||||
|
||||
### Требования
|
||||
|
||||
- [ESLint](https://eslint.org/)
|
||||
|
||||
### Подключание
|
||||
|
||||
```js
|
||||
import config from '@advdominion/eslint-config';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
export default defineConfig([
|
||||
...config,
|
||||
// Дополнительная конфигурация проекта
|
||||
]);
|
||||
```
|
||||
@@ -1,132 +0,0 @@
|
||||
/* eslint-disable unicorn/no-useless-spread */
|
||||
|
||||
import js from '@eslint/js';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
||||
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
||||
import pluginVue from 'eslint-plugin-vue';
|
||||
import globals from 'globals';
|
||||
|
||||
const config = [
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.nodeBuiltin,
|
||||
},
|
||||
},
|
||||
},
|
||||
js.configs.recommended,
|
||||
{
|
||||
rules: {
|
||||
...{
|
||||
// Включаем правила из категории Possible Problems, которые не включенны в recommended
|
||||
'array-callback-return': 'error',
|
||||
'no-await-in-loop': 'warn',
|
||||
'no-duplicate-imports': 'warn',
|
||||
'no-promise-executor-return': 'error',
|
||||
'no-self-compare': 'error',
|
||||
'no-template-curly-in-string': 'warn',
|
||||
'no-unmodified-loop-condition': 'error',
|
||||
'no-unreachable-loop': 'error',
|
||||
'no-use-before-define': 'error',
|
||||
},
|
||||
...{
|
||||
// Включаем правила из категории Suggestions, которые не включенны в recommended
|
||||
'dot-notation': 'warn',
|
||||
'eqeqeq': 'error',
|
||||
'no-implicit-coercion': 'warn',
|
||||
'no-negated-condition': 'warn',
|
||||
'no-useless-concat': 'warn',
|
||||
'object-shorthand': 'warn',
|
||||
'func-style': 'error',
|
||||
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||
'no-param-reassign': 'error',
|
||||
'no-var': 'error',
|
||||
'one-var': ['warn', 'never'],
|
||||
'prefer-const': 'warn',
|
||||
'prefer-template': 'warn',
|
||||
},
|
||||
...{
|
||||
// Переопределяем правила, которые включены в recommended
|
||||
'no-irregular-whitespace': ['error', { skipTemplates: true }],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
'simple-import-sort': simpleImportSort,
|
||||
},
|
||||
rules: {
|
||||
'simple-import-sort/imports': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
unicorn: eslintPluginUnicorn,
|
||||
},
|
||||
rules: {
|
||||
...Object.fromEntries(
|
||||
Object.entries(eslintPluginUnicorn.configs.recommended.rules).map(([rule, level]) => [
|
||||
rule,
|
||||
level === 'off' ? 'off' : 'warn',
|
||||
]),
|
||||
),
|
||||
'unicorn/better-regex': 'warn',
|
||||
'unicorn/filename-case': ['warn', { cases: { kebabCase: true, pascalCase: true } }],
|
||||
'unicorn/prefer-global-this': 'off',
|
||||
'unicorn/prefer-import-meta-properties': 'warn',
|
||||
'unicorn/prevent-abbreviations': 'off',
|
||||
},
|
||||
},
|
||||
...pluginVue.configs['flat/recommended'],
|
||||
{
|
||||
rules: {
|
||||
...{
|
||||
'vue/no-v-html': 'off',
|
||||
'vue/one-component-per-file': 'off',
|
||||
},
|
||||
...{
|
||||
'vue/component-name-in-template-casing': 'warn',
|
||||
'vue/component-options-name-casing': 'warn',
|
||||
'vue/custom-event-name-casing': 'warn',
|
||||
'vue/match-component-file-name': ['warn', { extensions: ['vue'], shouldMatchCase: true }],
|
||||
'vue/match-component-import-name': 'warn',
|
||||
'vue/no-boolean-default': 'warn',
|
||||
'vue/no-potential-component-option-typo': 'warn',
|
||||
'vue/no-useless-mustaches': 'warn',
|
||||
'vue/no-useless-v-bind': 'warn',
|
||||
'vue/require-direct-export': 'warn',
|
||||
'vue/require-name-property': 'warn',
|
||||
'vue/v-for-delimiter-style': 'warn',
|
||||
'vue/v-on-handler-style': ['warn', 'inline'],
|
||||
},
|
||||
...{
|
||||
'vue/dot-notation': 'warn',
|
||||
'vue/eqeqeq': 'error',
|
||||
'vue/no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||
'vue/no-constant-condition': 'error',
|
||||
'vue/no-empty-pattern': 'error',
|
||||
'vue/no-implicit-coercion': 'warn',
|
||||
'vue/no-irregular-whitespace': ['error', { skipTemplates: true }],
|
||||
'vue/no-loss-of-precision': 'error',
|
||||
'vue/no-negated-condition': 'warn',
|
||||
'vue/no-sparse-arrays': 'error',
|
||||
'vue/no-useless-concat': 'warn',
|
||||
'vue/object-shorthand': 'warn',
|
||||
'vue/prefer-template': 'warn',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.vue'],
|
||||
rules: {
|
||||
'no-useless-assignment': 'off', // ESLint не умеет работать с этим правилом внутри <template>
|
||||
},
|
||||
},
|
||||
eslintConfigPrettier,
|
||||
];
|
||||
|
||||
export default config;
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "@advdominion/eslint-config",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-unicorn": "^64.0.0",
|
||||
"eslint-plugin-vue": "^10.8.0",
|
||||
"globals": "^17.4.0",
|
||||
"vue-eslint-parser": "^10.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^10.0.0"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
export default {
|
||||
printWidth: 120,
|
||||
singleQuote: true,
|
||||
quoteProps: 'consistent',
|
||||
overrides: [
|
||||
{
|
||||
files: 'packages/*/package.json',
|
||||
options: {
|
||||
tabWidth: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user