@servicetitan/eslint-plugin-folder-schema 33.1.0 → 34.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":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAqD9B,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,QAAA,MAAM,MAAM;;kDAMD;YACC,MAAM,EAAE,MAAM,CAAC;YACf,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,IAAI,CAAC,EAAE,MAAM,CAAC;SACjB,KAAG,MAAM,EAAE;;CAWnB,CAAC;AAGF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAsD9B,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,QAAA,MAAM,MAAM;;kDAMD;YACC,MAAM,EAAE,MAAM,CAAC;YACf,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,IAAI,CAAC,EAAE,MAAM,CAAC;SACjB,KAAG,MAAM,EAAE;;CAWnB,CAAC;AAGF,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -18,8 +18,8 @@ _export(exports, {
18
18
  }
19
19
  });
20
20
  const _folderlint = /*#__PURE__*/ _interop_require_wildcard(require("@servicetitan/folder-lint"));
21
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
22
21
  const _memoize = /*#__PURE__*/ _interop_require_default(require("lodash/memoize"));
22
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
23
23
  function _interop_require_default(obj) {
24
24
  return obj && obj.__esModule ? obj : {
25
25
  default: obj
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Config } from '@eslint/config-helpers';\nimport * as FolderLint from '@servicetitan/folder-lint';\nimport path from 'path';\nimport { Rule } from 'eslint';\nimport memoize from 'lodash/memoize';\n\nconst checkPath = memoize((configPath: string) =>\n FolderLint.checkPath(require(configPath).default)\n);\n\ninterface Options {\n config: string;\n docLink?: string;\n root: string;\n}\n\nconst check: Rule.RuleModule = {\n meta: {\n schema: {\n type: 'array',\n minItems: 1,\n maxItems: 1,\n contains: {\n type: 'object',\n properties: {\n root: { type: 'string' },\n config: { type: 'string' },\n docLink: { type: 'string' },\n },\n required: ['root', 'config'],\n },\n },\n },\n create(context: Rule.RuleContext & { options: Options[] }) {\n const { config, root, docLink } = context.options[0];\n\n const pathToCheck = path.relative(root, context.getFilename());\n\n checkPath(config)(pathToCheck).forEach(failure =>\n context.report({\n message: FolderLint.printFailure(failure) + printDetails(docLink),\n loc: {\n start: { line: 0, column: 0 },\n end: { line: 0, column: 0 },\n },\n })\n );\n\n return {};\n },\n};\n\nfunction printDetails(docLink?: string): string {\n return docLink ? ' More details: ' + docLink : '';\n}\n\nexport const rules = {\n check,\n};\n\nconst plugin = {\n configs: {\n recommended: ({\n config,\n docLink = 'https://docs.st.dev/docs/frontend/file-structure',\n root = process.cwd(),\n }: {\n config: string;\n docLink?: string;\n root?: string;\n }): Config[] => [\n {\n plugins: {\n '@servicetitan/folder-schema': { rules },\n },\n rules: {\n '@servicetitan/folder-schema/check': ['error', { root, config, docLink }],\n },\n },\n ],\n },\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default plugin;\n"],"names":["rules","checkPath","memoize","configPath","FolderLint","require","default","check","meta","schema","type","minItems","maxItems","contains","properties","root","config","docLink","required","create","context","options","pathToCheck","path","relative","getFilename","forEach","failure","report","message","printFailure","printDetails","loc","start","line","column","end","plugin","configs","recommended","process","cwd","plugins"],"m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e;gBACZ;oBACIC,SAAS;wBACL,+BAA+B;4BAAE1C;wBAAM;oBAC3C;oBACAA,OAAO;wBACH,qCAAqC;4BAAC;4BAAS;gCAAEe;gCAAMC;gCAAQC;4BAAQ;yBAAE;oBAC7E;gBACJ;aACH;IACL;AACJ;MAGA,WAAeoB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Config } from '@eslint/config-helpers';\nimport * as FolderLint from '@servicetitan/folder-lint';\nimport { Rule } from 'eslint';\nimport memoize from 'lodash/memoize';\nimport path from 'path';\n\nconst checkPath = memoize((configPath: string) =>\n FolderLint.checkPath(require(configPath).default)\n);\n\ninterface Options {\n config: string;\n docLink?: string;\n root: string;\n}\n\nconst check: Rule.RuleModule = {\n meta: {\n schema: {\n type: 'array',\n minItems: 1,\n maxItems: 1,\n contains: {\n type: 'object',\n properties: {\n root: { type: 'string' },\n config: { type: 'string' },\n docLink: { type: 'string' },\n },\n required: ['root', 'config'],\n },\n },\n },\n create(context: Rule.RuleContext & { options: Options[] }) {\n const { config, root, docLink } = context.options[0];\n\n const pathToCheck = path.relative(root, context.getFilename());\n\n checkPath(config)(pathToCheck).forEach(failure =>\n context.report({\n message: FolderLint.printFailure(failure) + printDetails(docLink),\n loc: {\n start: { line: 0, column: 0 },\n end: { line: 0, column: 0 },\n },\n })\n );\n\n return {};\n },\n};\n\nfunction printDetails(docLink?: string): string {\n return docLink ? ' More details: ' + docLink : '';\n}\n\nexport const rules = {\n check,\n};\n\nconst plugin = {\n configs: {\n recommended: ({\n config,\n docLink = 'https://docs.st.dev/docs/frontend/file-structure',\n root = process.cwd(),\n }: {\n config: string;\n docLink?: string;\n root?: string;\n }): Config[] => [\n {\n plugins: {\n '@servicetitan/folder-schema': { rules },\n },\n rules: {\n '@servicetitan/folder-schema/check': ['error', { root, config, docLink }],\n },\n },\n ],\n },\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default plugin;\n"],"names":["rules","checkPath","memoize","configPath","FolderLint","require","default","check","meta","schema","type","minItems","maxItems","contains","properties","root","config","docLink","required","create","context","options","pathToCheck","path","relative","getFilename","forEach","failure","report","message","printFailure","printDetails","loc","start","line","column","end","plugin","configs","recommended","process","cwd","plugins"],"mappings":";;;;;;;;;;;QAmFA,oDAAoD;IACpD;eAAA;;QA5BaA;eAAAA;;;oEAvDe;gEAER;6DACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjB,MAAMC,YAAYC,IAAAA,gBAAO,EAAC,CAACC,aACvBC,YAAWH,SAAS,CAACI,QAAQF,YAAYG,OAAO;AASpD,MAAMC,QAAyB;IAC3BC,MAAM;QACFC,QAAQ;YACJC,MAAM;YACNC,UAAU;YACVC,UAAU;YACVC,UAAU;gBACNH,MAAM;gBACNI,YAAY;oBACRC,MAAM;wBAAEL,MAAM;oBAAS;oBACvBM,QAAQ;wBAAEN,MAAM;oBAAS;oBACzBO,SAAS;wBAAEP,MAAM;oBAAS;gBAC9B;gBACAQ,UAAU;oBAAC;oBAAQ;iBAAS;YAChC;QACJ;IACJ;IACAC,QAAOC,OAAkD;QACrD,MAAM,EAAEJ,MAAM,EAAED,IAAI,EAAEE,OAAO,EAAE,GAAGG,QAAQC,OAAO,CAAC,EAAE;QAEpD,MAAMC,cAAcC,aAAI,CAACC,QAAQ,CAACT,MAAMK,QAAQK,WAAW;QAE3DxB,UAAUe,QAAQM,aAAaI,OAAO,CAACC,CAAAA,UACnCP,QAAQQ,MAAM,CAAC;gBACXC,SAASzB,YAAW0B,YAAY,CAACH,WAAWI,aAAad;gBACzDe,KAAK;oBACDC,OAAO;wBAAEC,MAAM;wBAAGC,QAAQ;oBAAE;oBAC5BC,KAAK;wBAAEF,MAAM;wBAAGC,QAAQ;oBAAE;gBAC9B;YACJ;QAGJ,OAAO,CAAC;IACZ;AACJ;AAEA,SAASJ,aAAad,OAAgB;IAClC,OAAOA,UAAU,oBAAoBA,UAAU;AACnD;AAEO,MAAMjB,QAAQ;IACjBO;AACJ;AAEA,MAAM8B,SAAS;IACXC,SAAS;QACLC,aAAa,CAAC,EACVvB,MAAM,EACNC,UAAU,kDAAkD,EAC5DF,OAAOyB,QAAQC,GAAG,EAAE,EAKvB,GAAe;gBACZ;oBACIC,SAAS;wBACL,+BAA+B;4BAAE1C;wBAAM;oBAC3C;oBACAA,OAAO;wBACH,qCAAqC;4BAAC;4BAAS;gCAAEe;gCAAMC;gCAAQC;4BAAQ;yBAAE;oBAC7E;gBACJ;aACH;IACL;AACJ;MAGA,WAAeoB"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@servicetitan/eslint-plugin-folder-schema",
3
- "version": "33.1.0",
4
- "description": "",
5
- "homepage": "https://docs.st.dev/docs/frontend/folder-schema",
3
+ "version": "34.0.0",
4
+ "description": "ESLint plugin to configure a strict hierarchy of files in your project",
5
+ "homepage": "https://docs.st.dev/docs/frontend/uikit/folder-schema",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/servicetitan/uikit.git",
@@ -16,13 +16,13 @@
16
16
  "src"
17
17
  ],
18
18
  "dependencies": {
19
- "@servicetitan/folder-lint": "33.1.0",
20
- "lodash": "~4.17.21"
19
+ "@servicetitan/folder-lint": "34.0.0",
20
+ "lodash": "~4.17.23"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/eslint": "~9.6.1",
24
- "@types/lodash": "~4.14.178",
25
- "eslint": "~9.39.1"
24
+ "@types/lodash": "~4.17.23",
25
+ "eslint": "~9.39.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@eslint/config-helpers": "*",
@@ -34,5 +34,5 @@
34
34
  "cli": {
35
35
  "webpack": false
36
36
  },
37
- "gitHead": "126948560bcb684f276373beb7ce45faac94205c"
37
+ "gitHead": "e193dc22703963f67099874a24de535d0696b6e2"
38
38
  }
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Config } from '@eslint/config-helpers';
2
2
  import * as FolderLint from '@servicetitan/folder-lint';
3
- import path from 'path';
4
3
  import { Rule } from 'eslint';
5
4
  import memoize from 'lodash/memoize';
5
+ import path from 'path';
6
6
 
7
7
  const checkPath = memoize((configPath: string) =>
8
8
  FolderLint.checkPath(require(configPath).default)