@servicetitan/eslint-plugin-folder-schema 37.0.2 → 38.1.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.
package/dist/index.js CHANGED
@@ -34,18 +34,12 @@ function _getRequireWildcardCache(nodeInterop) {
34
34
  })(nodeInterop);
35
35
  }
36
36
  function _interop_require_wildcard(obj, nodeInterop) {
37
- if (!nodeInterop && obj && obj.__esModule) {
38
- return obj;
39
- }
40
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
41
- return {
42
- default: obj
43
- };
44
- }
37
+ if (!nodeInterop && obj && obj.__esModule) return obj;
38
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") return {
39
+ default: obj
40
+ };
45
41
  var cache = _getRequireWildcardCache(nodeInterop);
46
- if (cache && cache.has(obj)) {
47
- return cache.get(obj);
48
- }
42
+ if (cache && cache.has(obj)) return cache.get(obj);
49
43
  var newObj = {
50
44
  __proto__: null
51
45
  };
@@ -53,17 +47,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
53
47
  for(var key in obj){
54
48
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
55
49
  var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
56
- if (desc && (desc.get || desc.set)) {
57
- Object.defineProperty(newObj, key, desc);
58
- } else {
59
- newObj[key] = obj[key];
60
- }
50
+ if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
51
+ else newObj[key] = obj[key];
61
52
  }
62
53
  }
63
54
  newObj.default = obj;
64
- if (cache) {
65
- cache.set(obj, newObj);
66
- }
55
+ if (cache) cache.set(obj, newObj);
67
56
  return newObj;
68
57
  }
69
58
  const checkPath = (0, _memoize.default)((configPath)=>_folderlint.checkPath(require(configPath).default));
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 { 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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BAC7E;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":";;;;;;;;;;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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,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/eslint-plugin-folder-schema",
3
- "version": "37.0.2",
3
+ "version": "38.1.0",
4
4
  "description": "ESLint plugin to configure a strict hierarchy of files in your project",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/uikit/folder-schema",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  "src"
17
17
  ],
18
18
  "dependencies": {
19
- "@servicetitan/folder-lint": "37.0.2",
19
+ "@servicetitan/folder-lint": "38.1.0",
20
20
  "lodash": "^4.18.1"
21
21
  },
22
22
  "devDependencies": {
@@ -36,5 +36,5 @@
36
36
  "DEVELOPER_NOTES": {
37
37
  "@eslint/config-helpers": "Use the version required by eslint"
38
38
  },
39
- "gitHead": "d30a9eb850b4bdb98b6af7cc06fade1359fcc943"
39
+ "gitHead": "e8c601a26ad49ca0d6b0b84a9f530f3242d53c7f"
40
40
  }