Skip to content

Commit 14385a4

Browse files
committed
Add basic eslint enforcement
1 parent 7f71155 commit 14385a4

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

eslint.config.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ export default [
140140
"no-async-foreach/no-async-foreach": "error",
141141
"no-sequences": "error",
142142
"no-shadow": "off",
143+
144+
// A basic check that we don't use `exportVariable` from `@actions/core`. This rule depends on
145+
// the module being imported as `core`, but that is a good enough check for us.
146+
"no-restricted-syntax": [
147+
"error",
148+
{
149+
selector:
150+
"MemberExpression[object.name='core'][property.name='exportVariable']",
151+
message: "Use `exportVariable` from `environment.ts` instead.",
152+
},
153+
],
154+
143155
// This is overly restrictive with unsetting `EnvVar`s
144156
"@typescript-eslint/no-dynamic-delete": "off",
145157
"@typescript-eslint/no-shadow": "error",
@@ -157,6 +169,15 @@ export default [
157169
],
158170
},
159171
},
172+
{
173+
files: ["src/environment.ts"],
174+
175+
// We allow `exportVariable` from `@actions/core` to be used in this file
176+
// since it defines the wrapper around it that other modules use.
177+
rules: {
178+
"no-restricted-syntax": "off",
179+
},
180+
},
160181
{
161182
files: ["**/*.ts", "**/*.js"],
162183

0 commit comments

Comments
 (0)