@prairielearn/eslint-config 2.1.0 → 3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @prairielearn/eslint-config
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 4a01211: Bump `typescript` peer dependency to `^6.0.0`.
8
+
9
+ ### Minor Changes
10
+
11
+ - f83d484: Add `require-trpc-permission-middleware` rule that flags any `t.procedure` chain missing a permission middleware (`requireCoursePermission*`, `requireCourseInstancePermission*`, or `requireAdministrator`). The rule is wired up automatically for files under `**/src/trpc/**/*.ts`.
12
+
13
+ ### Patch Changes
14
+
15
+ - 382dbd8: Bump dependencies
16
+ - Updated dependencies [382dbd8]
17
+ - Updated dependencies [f83d484]
18
+ - @prairielearn/eslint-plugin@4.2.0
19
+
3
20
  ## 2.1.0
4
21
 
5
22
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"prairielearn.d.ts","sourceRoot":"","sources":["../../src/configs/prairielearn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,CAAC,EAAE,yBAAyB,GAClC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAyBjC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\nimport prairielearn from '@prairielearn/eslint-plugin';\n\nexport interface PrairieLearnPluginOptions {\n /**\n * Types to allow when using the safe-db-types rule.\n */\n allowDbTypes?: string[];\n}\n\n/**\n * PrairieLearn-specific ESLint plugin rules.\n * Includes AWS client configuration, JSX safety, SQL blocks, and database type safety.\n */\nexport function prairieLearnConfig(\n options?: PrairieLearnPluginOptions,\n): TSESLint.FlatConfig.ConfigArray {\n const { allowDbTypes = [] } = options ?? {};\n\n return [\n {\n plugins: {\n '@prairielearn': prairielearn,\n },\n\n rules: {\n '@prairielearn/aws-client-mandatory-config': 'error',\n '@prairielearn/aws-client-shared-config': 'error',\n '@prairielearn/jsx-no-dollar-interpolation': 'error',\n '@prairielearn/no-current-target-in-callback': 'error',\n '@prairielearn/no-hydrate-reslocals': 'error',\n '@prairielearn/no-unused-sql-blocks': 'error',\n '@prairielearn/safe-db-types': [\n 'error',\n {\n allowDbTypes,\n },\n ],\n },\n },\n ];\n}\n"]}
1
+ {"version":3,"file":"prairielearn.d.ts","sourceRoot":"","sources":["../../src/configs/prairielearn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,CAAC,EAAE,yBAAyB,GAClC,QAAQ,CAAC,UAAU,CAAC,WAAW,CA+BjC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\nimport prairielearn from '@prairielearn/eslint-plugin';\n\nexport interface PrairieLearnPluginOptions {\n /**\n * Types to allow when using the safe-db-types rule.\n */\n allowDbTypes?: string[];\n}\n\n/**\n * PrairieLearn-specific ESLint plugin rules.\n * Includes AWS client configuration, JSX safety, SQL blocks, and database type safety.\n */\nexport function prairieLearnConfig(\n options?: PrairieLearnPluginOptions,\n): TSESLint.FlatConfig.ConfigArray {\n const { allowDbTypes = [] } = options ?? {};\n\n return [\n {\n plugins: {\n '@prairielearn': prairielearn,\n },\n\n rules: {\n '@prairielearn/aws-client-mandatory-config': 'error',\n '@prairielearn/aws-client-shared-config': 'error',\n '@prairielearn/jsx-no-dollar-interpolation': 'error',\n '@prairielearn/no-current-target-in-callback': 'error',\n '@prairielearn/no-hydrate-reslocals': 'error',\n '@prairielearn/no-unused-sql-blocks': 'error',\n '@prairielearn/safe-db-types': [\n 'error',\n {\n allowDbTypes,\n },\n ],\n },\n },\n {\n files: ['**/src/trpc/**/*.ts'],\n rules: {\n '@prairielearn/require-trpc-permission-middleware': 'error',\n },\n },\n ];\n}\n"]}
@@ -25,6 +25,12 @@ export function prairieLearnConfig(options) {
25
25
  ],
26
26
  },
27
27
  },
28
+ {
29
+ files: ['**/src/trpc/**/*.ts'],
30
+ rules: {
31
+ '@prairielearn/require-trpc-permission-middleware': 'error',
32
+ },
33
+ },
28
34
  ];
29
35
  }
30
36
  //# sourceMappingURL=prairielearn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prairielearn.js","sourceRoot":"","sources":["../../src/configs/prairielearn.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,6BAA6B,CAAC;AASvD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAmC;IAEnC,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE5C,OAAO;QACL;YACE,OAAO,EAAE;gBACP,eAAe,EAAE,YAAY;aAC9B;YAED,KAAK,EAAE;gBACL,2CAA2C,EAAE,OAAO;gBACpD,wCAAwC,EAAE,OAAO;gBACjD,2CAA2C,EAAE,OAAO;gBACpD,6CAA6C,EAAE,OAAO;gBACtD,oCAAoC,EAAE,OAAO;gBAC7C,oCAAoC,EAAE,OAAO;gBAC7C,6BAA6B,EAAE;oBAC7B,OAAO;oBACP;wBACE,YAAY;qBACb;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\nimport prairielearn from '@prairielearn/eslint-plugin';\n\nexport interface PrairieLearnPluginOptions {\n /**\n * Types to allow when using the safe-db-types rule.\n */\n allowDbTypes?: string[];\n}\n\n/**\n * PrairieLearn-specific ESLint plugin rules.\n * Includes AWS client configuration, JSX safety, SQL blocks, and database type safety.\n */\nexport function prairieLearnConfig(\n options?: PrairieLearnPluginOptions,\n): TSESLint.FlatConfig.ConfigArray {\n const { allowDbTypes = [] } = options ?? {};\n\n return [\n {\n plugins: {\n '@prairielearn': prairielearn,\n },\n\n rules: {\n '@prairielearn/aws-client-mandatory-config': 'error',\n '@prairielearn/aws-client-shared-config': 'error',\n '@prairielearn/jsx-no-dollar-interpolation': 'error',\n '@prairielearn/no-current-target-in-callback': 'error',\n '@prairielearn/no-hydrate-reslocals': 'error',\n '@prairielearn/no-unused-sql-blocks': 'error',\n '@prairielearn/safe-db-types': [\n 'error',\n {\n allowDbTypes,\n },\n ],\n },\n },\n ];\n}\n"]}
1
+ {"version":3,"file":"prairielearn.js","sourceRoot":"","sources":["../../src/configs/prairielearn.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,6BAA6B,CAAC;AASvD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAmC;IAEnC,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE5C,OAAO;QACL;YACE,OAAO,EAAE;gBACP,eAAe,EAAE,YAAY;aAC9B;YAED,KAAK,EAAE;gBACL,2CAA2C,EAAE,OAAO;gBACpD,wCAAwC,EAAE,OAAO;gBACjD,2CAA2C,EAAE,OAAO;gBACpD,6CAA6C,EAAE,OAAO;gBACtD,oCAAoC,EAAE,OAAO;gBAC7C,oCAAoC,EAAE,OAAO;gBAC7C,6BAA6B,EAAE;oBAC7B,OAAO;oBACP;wBACE,YAAY;qBACb;iBACF;aACF;SACF;QACD;YACE,KAAK,EAAE,CAAC,qBAAqB,CAAC;YAC9B,KAAK,EAAE;gBACL,kDAAkD,EAAE,OAAO;aAC5D;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\nimport prairielearn from '@prairielearn/eslint-plugin';\n\nexport interface PrairieLearnPluginOptions {\n /**\n * Types to allow when using the safe-db-types rule.\n */\n allowDbTypes?: string[];\n}\n\n/**\n * PrairieLearn-specific ESLint plugin rules.\n * Includes AWS client configuration, JSX safety, SQL blocks, and database type safety.\n */\nexport function prairieLearnConfig(\n options?: PrairieLearnPluginOptions,\n): TSESLint.FlatConfig.ConfigArray {\n const { allowDbTypes = [] } = options ?? {};\n\n return [\n {\n plugins: {\n '@prairielearn': prairielearn,\n },\n\n rules: {\n '@prairielearn/aws-client-mandatory-config': 'error',\n '@prairielearn/aws-client-shared-config': 'error',\n '@prairielearn/jsx-no-dollar-interpolation': 'error',\n '@prairielearn/no-current-target-in-callback': 'error',\n '@prairielearn/no-hydrate-reslocals': 'error',\n '@prairielearn/no-unused-sql-blocks': 'error',\n '@prairielearn/safe-db-types': [\n 'error',\n {\n allowDbTypes,\n },\n ],\n },\n },\n {\n files: ['**/src/trpc/**/*.ts'],\n rules: {\n '@prairielearn/require-trpc-permission-middleware': 'error',\n },\n },\n ];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prairielearn/eslint-config",
3
- "version": "2.1.0",
3
+ "version": "3.0.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,34 +20,34 @@
20
20
  },
21
21
  "peerDependencies": {
22
22
  "eslint": "^10.0.0",
23
- "typescript": "^5.0.0"
23
+ "typescript": "^6.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "@eslint-react/eslint-plugin": "^4.2.3",
27
- "@eslint/config-helpers": "^0.5.4",
26
+ "@eslint-react/eslint-plugin": "^5.7.2",
27
+ "@eslint/config-helpers": "^0.5.5",
28
28
  "@eslint/eslintrc": "^3.3.5",
29
29
  "@eslint/js": "^10.0.1",
30
- "@prairielearn/eslint-plugin": "^4.1.0",
30
+ "@prairielearn/eslint-plugin": "^4.2.0",
31
31
  "@stylistic/eslint-plugin": "^5.10.0",
32
- "@tanstack/eslint-plugin-query": "^5.96.2",
33
- "@typescript-eslint/utils": "^8.58.0",
34
- "@vitest/eslint-plugin": "^1.6.14",
32
+ "@tanstack/eslint-plugin-query": "^5.100.9",
33
+ "@typescript-eslint/utils": "^8.59.2",
34
+ "@vitest/eslint-plugin": "^1.6.16",
35
35
  "eslint-import-resolver-typescript": "^4.4.4",
36
36
  "eslint-plugin-import-x": "^4.16.2",
37
37
  "eslint-plugin-jsdoc": "^62.9.0",
38
38
  "eslint-plugin-jsx-a11y-x": "^0.1.1",
39
39
  "eslint-plugin-no-floating-promise": "^2.0.0",
40
- "eslint-plugin-perfectionist": "^5.8.0",
41
- "eslint-plugin-react-hooks": "^7.0.1",
42
- "eslint-plugin-react-you-might-not-need-an-effect": "^0.9.2",
40
+ "eslint-plugin-perfectionist": "^5.9.0",
41
+ "eslint-plugin-react-hooks": "^7.1.1",
42
+ "eslint-plugin-react-you-might-not-need-an-effect": "^0.10.0",
43
43
  "eslint-plugin-unicorn": "^64.0.0",
44
44
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
45
- "globals": "^17.4.0",
46
- "typescript-eslint": "^8.58.0"
45
+ "globals": "^17.6.0",
46
+ "typescript-eslint": "^8.59.2"
47
47
  },
48
48
  "devDependencies": {
49
- "@prairielearn/tsconfig": "^2.0.0",
49
+ "@prairielearn/tsconfig": "^2.1.0",
50
50
  "@types/node": "^24.12.2",
51
- "@typescript/native-preview": "^7.0.0-dev.20260305.1"
51
+ "@typescript/native-preview": "beta"
52
52
  }
53
53
  }
@@ -39,5 +39,11 @@ export function prairieLearnConfig(
39
39
  ],
40
40
  },
41
41
  },
42
+ {
43
+ files: ['**/src/trpc/**/*.ts'],
44
+ rules: {
45
+ '@prairielearn/require-trpc-permission-middleware': 'error',
46
+ },
47
+ },
42
48
  ];
43
49
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,3 @@
1
1
  {
2
- "extends": "@prairielearn/tsconfig/tsconfig.package.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "dist"
6
- }
2
+ "extends": "@prairielearn/tsconfig/tsconfig.package-node.json"
7
3
  }