UNPKG

ocrmnav

Version:

DevStack - The Complete Developer Toolkit - Virtual file system, workflow automation, and more than 65+ other development tools / features in one seamless extension. Cutting down dev times never before seen.

273 lines (220 loc) 7.44 kB
"use strict"; exports.id = 112; exports.ids = [112]; exports.modules = { /***/ 1532: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isStandardSyntaxAtRule) /* harmony export */ }); /** * Check whether a at-rule is standard * * @param {import('postcss').AtRule | import('postcss-less').AtRule} atRule postcss at-rule node * @returns {boolean} If `true`, the declaration is standard */ function isStandardSyntaxAtRule(atRule) { // Ignore `@charset` css rule (is parsed as at-rule) if (atRule.name.toLowerCase() === 'charset') { return false; } // Ignore scss `@content` inside mixins if (!atRule.nodes && atRule.params === '') { return false; } // Ignore Less mixins if ('mixin' in atRule && atRule.mixin) { return false; } // Ignore Less detached ruleset `@detached-ruleset: { background: red; }; .top { @detached-ruleset(); }` if ( ('variable' in atRule && atRule.variable) || (!atRule.nodes && atRule.raws.afterName === '' && atRule.params[0] === '(') ) { return false; } return true; } /***/ }), /***/ 1536: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ atKeywords: () => (/* binding */ atKeywords), /* harmony export */ deprecatedAtKeywords: () => (/* binding */ deprecatedAtKeywords), /* harmony export */ nestingSupportedAtKeywords: () => (/* binding */ nestingSupportedAtKeywords), /* harmony export */ pageMarginAtKeywords: () => (/* binding */ pageMarginAtKeywords) /* harmony export */ }); /* harmony import */ var _utils_uniteSets_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1537); /** @type {ReadonlySet<string>} */ const deprecatedAtKeywords = new Set(['document', 'nest', 'viewport']); /** * @see https://www.w3.org/TR/css-nesting-1/#conditionals * @type {ReadonlySet<string>} */ const nestingSupportedAtKeywords = new Set([ 'apply', 'container', 'layer', 'media', 'scope', 'starting-style', 'supports', ]); /** * @see https://www.w3.org/TR/css-page-3/#syntax-page-selector * @type {ReadonlySet<string>} */ const pageMarginAtKeywords = new Set([ 'top-left-corner', 'top-left', 'top-center', 'top-right', 'top-right-corner', 'bottom-left-corner', 'bottom-left', 'bottom-center', 'bottom-right', 'bottom-right-corner', 'left-top', 'left-middle', 'left-bottom', 'right-top', 'right-middle', 'right-bottom', ]); /** * @see https://www.w3.org/TR/css-fonts-4/#font-feature-values-font-feature-value-type * @type {ReadonlySet<string>} */ const fontFeatureValueTypes = new Set([ 'annotation', 'character-variant', 'historical-forms', 'ornaments', 'styleset', 'stylistic', 'swash', ]); /** * @see https://developer.mozilla.org/en/docs/Web/CSS/At-rule * @type {ReadonlySet<string>} */ const atKeywords = (0,_utils_uniteSets_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])( deprecatedAtKeywords, nestingSupportedAtKeywords, pageMarginAtKeywords, fontFeatureValueTypes, [ 'counter-style', 'custom-media', 'custom-selector', 'font-face', 'font-feature-values', 'font-palette-values', 'import', 'keyframes', 'namespace', 'page', 'position-try', 'property', 'scroll-timeline', 'view-transition', ], ); /***/ }), /***/ 1537: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ uniteSets) /* harmony export */ }); /** * Unite two or more sets * * @param {Iterable<string>[]} args * @see {@link https://github.com/microsoft/TypeScript/issues/57228|GitHub} */ function uniteSets(...args) { return new Set([...args].reduce((result, set) => [...result, ...set], [])); } /***/ }), /***/ 1557: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var postcss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(835); /* harmony import */ var _utils_validateTypes_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(579); /* harmony import */ var _reference_atKeywords_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1536); /* harmony import */ var _utils_isStandardSyntaxAtRule_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1532); /* harmony import */ var _utils_optionsMatches_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(869); /* harmony import */ var _utils_report_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(945); /* harmony import */ var _utils_ruleMessages_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(950); /* harmony import */ var _utils_validateOptions_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(873); const ruleName = 'at-rule-no-deprecated'; const messages = (0,_utils_ruleMessages_mjs__WEBPACK_IMPORTED_MODULE_6__["default"])(ruleName, { rejected: (atRule) => `Unexpected deprecated at-rule "${atRule}"`, }); const meta = { url: 'https://stylelint.io/user-guide/rules/at-rule-no-deprecated', fixable: true, }; /** @type {import('stylelint').CoreRules[ruleName]} */ const rule = (primary, secondaryOptions) => { return (root, result) => { const validOptions = (0,_utils_validateOptions_mjs__WEBPACK_IMPORTED_MODULE_7__["default"])( result, ruleName, { actual: primary }, { actual: secondaryOptions, possible: { ignoreAtRules: [_utils_validateTypes_mjs__WEBPACK_IMPORTED_MODULE_1__.isString, _utils_validateTypes_mjs__WEBPACK_IMPORTED_MODULE_1__.isRegExp], }, optional: true, }, ); if (!validOptions) return; root.walkAtRules((atRule) => { if (!(0,_utils_isStandardSyntaxAtRule_mjs__WEBPACK_IMPORTED_MODULE_3__["default"])(atRule)) return; const { name } = atRule; const normalizedName = name.toLowerCase(); if ((0,_utils_optionsMatches_mjs__WEBPACK_IMPORTED_MODULE_4__["default"])(secondaryOptions, 'ignoreAtRules', name)) return; if (!_reference_atKeywords_mjs__WEBPACK_IMPORTED_MODULE_2__.deprecatedAtKeywords.has(normalizedName)) return; const atNestFixer = () => { const styleRule = postcss__WEBPACK_IMPORTED_MODULE_0__["default"].rule({ selector: atRule.params, source: atRule.source, }); styleRule.append(atRule.nodes); atRule.replaceWith(styleRule); }; const fix = normalizedName === 'nest' ? atNestFixer : undefined; const atName = `@${name}`; (0,_utils_report_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])({ message: messages.rejected, messageArgs: [atName], node: atRule, ruleName, result, index: 0, endIndex: atName.length, fix: { apply: fix, node: atRule.parent, }, }); }); }; }; rule.ruleName = ruleName; rule.messages = messages; rule.meta = meta; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rule); /***/ }) }; ; //# sourceMappingURL=112.extension.js.map