![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/metras.v32.1/node_modules/stylelint/lib/ |
/* @flow */ "use strict"; /*:: type postcssType = { atRule: Function, comment: Function, decl: Function, list: any, parse: any, plugin: Function, root: Function, rule: Function, stringify: any, vendor: any, } */ const _ = require("lodash"); const createStylelint = require("./createStylelint"); const path = require("path"); const postcss /*: postcssType*/ = require("postcss"); //'block-no-empty': bool || Array /*:: type OptionsT = { config?: { extends?: Array<string>, plugins?: Array<string>, rules?: Object, }; configBasedir?: string; configFile?: string; defaultSeverity?: string; from?: string; ignoreDisables?: boolean; ignoreFiles?: string; pluginFunctions?: Object; plugins?: Array<string>; rules?: Object; } */ /*:: type rootParamT = { raws: { semicolon: boolean, after: string, }, type: string, nodes: Array<Object>, source: { input: { css: string, id?: string, file?: string, }, start: { line: number, column: number, } } } */ /*:: type resultParamT = { processor: { version: string, plugins: Array<Object>, }, messages: Array<any>, root: { raws: { semicolon: boolean, after: string, }, type: string, nodes: Array<Object>, source: { input: Object, start: Object, }, }, opts: { config?: { rules: Object, }, configFile?: string, defaultSeverity?: string, rules?: Object, ignoreDisables?: boolean, ignoreFiles?: string, from?: string, syntax?: { parse: Function, stringify: Function, } }, css: ?any, map: ?any, lastPlugin: { postcssPlugin: string, postcssVersion: string, } } */ /*:: type postcssPromise = Promise<?{ config: stylelint$config, filepath: string }>*/ module.exports = postcss.plugin("stylelint", function( options /*: OptionsT*/ ) /*: Function*/ { options = options || {}; const tailoredOptions /*: Object*/ = options.rules ? { config: options } : options; const stylelint /*: stylelint$internalApi*/ = createStylelint( tailoredOptions ); // prettier-ignore return (root/*: rootParamT*/, result/*: resultParamT*/)/*: Promise<any>*/ => { let filePath = options.from || _.get(root, "source.input.file"); if (filePath !== undefined && !path.isAbsolute(filePath)) { filePath = path.join(process.cwd(), filePath); } return stylelint._lintSource({ filePath, existingPostcssResult: result }); }; });