@servicetitan/stylelint-config 36.3.1 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"function-url-no-absolute.d.ts","sourceRoot":"","sources":["../src/function-url-no-absolute.ts"],"names":[],"mappings":";;;;;;AA+CA,kBAA+E"}
1
+ {"version":3,"file":"function-url-no-absolute.d.ts","sourceRoot":"","sources":["../src/function-url-no-absolute.ts"],"names":[],"mappings":";;;;;;AAoDA,kBAA+E"}
@@ -6,7 +6,7 @@ function _interop_require_default(obj) {
6
6
  default: obj
7
7
  };
8
8
  }
9
- const functionArgumentsSearch = require('stylelint/lib/utils/functionArgumentsSearch.cjs');
9
+ const functionArgumentsSearch = require('stylelint/lib/utils/functionArgumentsSearch.mjs').default;
10
10
  const isAbsoluteUrl = (url)=>/^\//.test(url) && !/^\/\//.test(url);
11
11
  const ruleName = '@servicetitan/function-url-no-absolute';
12
12
  const messages = _stylelint.utils.ruleMessages(ruleName, {
@@ -30,6 +30,7 @@ const plugin = (actual)=>{
30
30
  message: messages.rejected,
31
31
  node: decl,
32
32
  index,
33
+ endIndex: index + args.length,
33
34
  result,
34
35
  ruleName
35
36
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/function-url-no-absolute.ts"],"sourcesContent":["import trim from 'lodash/trim';\nimport { Rule, createPlugin, utils } from 'stylelint';\n\nconst functionArgumentsSearch = require('stylelint/lib/utils/functionArgumentsSearch.cjs') as (\n source: string,\n functionName: string,\n callback: (args: string, index: number) => void\n) => void;\n\nconst isAbsoluteUrl = (url: string) => /^\\//.test(url) && !/^\\/\\//.test(url);\n\nconst ruleName = '@servicetitan/function-url-no-absolute';\nconst messages = utils.ruleMessages(ruleName, {\n rejected: 'Unexpected absolute url',\n});\n\nconst plugin: Rule = actual => {\n return (root, result) => {\n const validOptions = utils.validateOptions(result, ruleName, { actual });\n\n if (!validOptions) {\n return;\n }\n\n root.walkDecls(decl => {\n functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => {\n const url = trim(args, ' \\'\"');\n\n if (!isAbsoluteUrl(url)) {\n return;\n }\n\n utils.report({\n message: messages.rejected,\n node: decl,\n index,\n result,\n ruleName,\n });\n });\n });\n };\n};\n\nplugin.ruleName = ruleName;\nplugin.messages = messages;\n\nexport = Object.assign(createPlugin(ruleName, plugin), { ruleName, messages });\n"],"names":["functionArgumentsSearch","require","isAbsoluteUrl","url","test","ruleName","messages","utils","ruleMessages","rejected","plugin","actual","root","result","validOptions","validateOptions","walkDecls","decl","toString","toLowerCase","args","index","trim","report","message","node","Object","assign","createPlugin"],"mappings":";6DAAiB;2BACyB;;;;;;AAE1C,MAAMA,0BAA0BC,QAAQ;AAMxC,MAAMC,gBAAgB,CAACC,MAAgB,MAAMC,IAAI,CAACD,QAAQ,CAAC,QAAQC,IAAI,CAACD;AAExE,MAAME,WAAW;AACjB,MAAMC,WAAWC,gBAAK,CAACC,YAAY,CAACH,UAAU;IAC1CI,UAAU;AACd;AAEA,MAAMC,SAAeC,CAAAA;IACjB,OAAO,CAACC,MAAMC;QACV,MAAMC,eAAeP,gBAAK,CAACQ,eAAe,CAACF,QAAQR,UAAU;YAAEM;QAAO;QAEtE,IAAI,CAACG,cAAc;YACf;QACJ;QAEAF,KAAKI,SAAS,CAACC,CAAAA;YACXjB,wBAAwBiB,KAAKC,QAAQ,GAAGC,WAAW,IAAI,OAAO,CAACC,MAAMC;gBACjE,MAAMlB,MAAMmB,IAAAA,aAAI,EAACF,MAAM;gBAEvB,IAAI,CAAClB,cAAcC,MAAM;oBACrB;gBACJ;gBAEAI,gBAAK,CAACgB,MAAM,CAAC;oBACTC,SAASlB,SAASG,QAAQ;oBAC1BgB,MAAMR;oBACNI;oBACAR;oBACAR;gBACJ;YACJ;QACJ;IACJ;AACJ;AAEAK,OAAOL,QAAQ,GAAGA;AAClBK,OAAOJ,QAAQ,GAAGA;iBAEToB,OAAOC,MAAM,CAACC,IAAAA,uBAAY,EAACvB,UAAUK,SAAS;IAAEL;IAAUC;AAAS"}
1
+ {"version":3,"sources":["../src/function-url-no-absolute.ts"],"sourcesContent":["import trim from 'lodash/trim';\nimport { Rule, createPlugin, utils } from 'stylelint';\n\nconst functionArgumentsSearch = (\n require('stylelint/lib/utils/functionArgumentsSearch.mjs') as {\n default: (\n source: string,\n functionName: string,\n callback: (args: string, index: number) => void\n ) => void;\n }\n).default;\n\nconst isAbsoluteUrl = (url: string) => /^\\//.test(url) && !/^\\/\\//.test(url);\n\nconst ruleName = '@servicetitan/function-url-no-absolute';\nconst messages = utils.ruleMessages(ruleName, {\n rejected: 'Unexpected absolute url',\n});\n\nconst plugin: Rule = actual => {\n return (root, result) => {\n const validOptions = utils.validateOptions(result, ruleName, { actual });\n\n if (!validOptions) {\n return;\n }\n\n root.walkDecls(decl => {\n functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => {\n const url = trim(args, ' \\'\"');\n\n if (!isAbsoluteUrl(url)) {\n return;\n }\n\n utils.report({\n message: messages.rejected,\n node: decl,\n index,\n endIndex: index + args.length,\n result,\n ruleName,\n });\n });\n });\n };\n};\n\nplugin.ruleName = ruleName;\nplugin.messages = messages;\n\nexport = Object.assign(createPlugin(ruleName, plugin), { ruleName, messages });\n"],"names":["functionArgumentsSearch","require","default","isAbsoluteUrl","url","test","ruleName","messages","utils","ruleMessages","rejected","plugin","actual","root","result","validOptions","validateOptions","walkDecls","decl","toString","toLowerCase","args","index","trim","report","message","node","endIndex","length","Object","assign","createPlugin"],"mappings":";6DAAiB;2BACyB;;;;;;AAE1C,MAAMA,0BAA0B,AAC5BC,QAAQ,mDAOVC,OAAO;AAET,MAAMC,gBAAgB,CAACC,MAAgB,MAAMC,IAAI,CAACD,QAAQ,CAAC,QAAQC,IAAI,CAACD;AAExE,MAAME,WAAW;AACjB,MAAMC,WAAWC,gBAAK,CAACC,YAAY,CAACH,UAAU;IAC1CI,UAAU;AACd;AAEA,MAAMC,SAAeC,CAAAA;IACjB,OAAO,CAACC,MAAMC;QACV,MAAMC,eAAeP,gBAAK,CAACQ,eAAe,CAACF,QAAQR,UAAU;YAAEM;QAAO;QAEtE,IAAI,CAACG,cAAc;YACf;QACJ;QAEAF,KAAKI,SAAS,CAACC,CAAAA;YACXlB,wBAAwBkB,KAAKC,QAAQ,GAAGC,WAAW,IAAI,OAAO,CAACC,MAAMC;gBACjE,MAAMlB,MAAMmB,IAAAA,aAAI,EAACF,MAAM;gBAEvB,IAAI,CAAClB,cAAcC,MAAM;oBACrB;gBACJ;gBAEAI,gBAAK,CAACgB,MAAM,CAAC;oBACTC,SAASlB,SAASG,QAAQ;oBAC1BgB,MAAMR;oBACNI;oBACAK,UAAUL,QAAQD,KAAKO,MAAM;oBAC7Bd;oBACAR;gBACJ;YACJ;QACJ;IACJ;AACJ;AAEAK,OAAOL,QAAQ,GAAGA;AAClBK,OAAOJ,QAAQ,GAAGA;iBAETsB,OAAOC,MAAM,CAACC,IAAAA,uBAAY,EAACzB,UAAUK,SAAS;IAAEL;IAAUC;AAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/stylelint-config",
3
- "version": "36.3.1",
3
+ "version": "37.0.0",
4
4
  "description": "Core Stylelint rule sets for ServiceTitan web projects",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/uikit/eslint-config",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@servicetitan/tokens": "~12.9.0",
28
28
  "@types/lodash": "~4.17.23",
29
- "stylelint": "~16.26.1"
29
+ "stylelint": "~17.13.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@servicetitan/tokens": ">=12",
@@ -39,5 +39,5 @@
39
39
  "cli": {
40
40
  "webpack": false
41
41
  },
42
- "gitHead": "93a049ba1e5cb737afb7bc95c06020736bc61a38"
42
+ "gitHead": "f0acf332ece207c91acb18da23a614efbc8551ec"
43
43
  }
@@ -1,11 +1,15 @@
1
1
  import trim from 'lodash/trim';
2
2
  import { Rule, createPlugin, utils } from 'stylelint';
3
3
 
4
- const functionArgumentsSearch = require('stylelint/lib/utils/functionArgumentsSearch.cjs') as (
5
- source: string,
6
- functionName: string,
7
- callback: (args: string, index: number) => void
8
- ) => void;
4
+ const functionArgumentsSearch = (
5
+ require('stylelint/lib/utils/functionArgumentsSearch.mjs') as {
6
+ default: (
7
+ source: string,
8
+ functionName: string,
9
+ callback: (args: string, index: number) => void
10
+ ) => void;
11
+ }
12
+ ).default;
9
13
 
10
14
  const isAbsoluteUrl = (url: string) => /^\//.test(url) && !/^\/\//.test(url);
11
15
 
@@ -34,6 +38,7 @@ const plugin: Rule = actual => {
34
38
  message: messages.rejected,
35
39
  node: decl,
36
40
  index,
41
+ endIndex: index + args.length,
37
42
  result,
38
43
  ruleName,
39
44
  });