From 84023e428c7f419db9217fe6f7ef37f53e2cce14 Mon Sep 17 00:00:00 2001 From: Roger Qiu Date: Sun, 1 Mar 2026 12:09:28 +0000 Subject: [PATCH 1/2] feat: added in no-restricted-syntax to ensure that top level function declarations are just function declarations rather than arrow function or variable assignments --- src/configs/eslint.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/configs/eslint.ts b/src/configs/eslint.ts index 50a90f5..ee8d38c 100644 --- a/src/configs/eslint.ts +++ b/src/configs/eslint.ts @@ -149,6 +149,21 @@ const config = [ message: 'Use `globalThis` instead', }, ], + 'no-restricted-syntax': [ + 'error', + { + selector: + 'Program > VariableDeclaration[kind="const"] > VariableDeclarator[id.type="Identifier"][init.type="ArrowFunctionExpression"]', + message: + 'Top-level functions must be declarations: `function foo() {}`', + }, + { + selector: + 'Program > VariableDeclaration[kind="const"] > VariableDeclarator[id.type="Identifier"][init.type="FunctionExpression"]', + message: + 'Top-level functions must be declarations: `function foo() {}`', + }, + ], 'prefer-rest-params': 0, 'require-yield': 0, eqeqeq: ['error', 'smart'], From 2a78e10446501473da1ad77db02c73256587333a Mon Sep 17 00:00:00 2001 From: Roger Qiu Date: Sun, 1 Mar 2026 12:14:28 +0000 Subject: [PATCH 2/2] 0.4.9 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 26d4f59..0d4c73f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/lint", - "version": "0.4.8", + "version": "0.4.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/lint", - "version": "0.4.8", + "version": "0.4.9", "license": "Apache-2.0", "dependencies": { "@eslint/compat": "^1.2.5", diff --git a/package.json b/package.json index 5f59c23..05e2609 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/lint", - "version": "0.4.8", + "version": "0.4.9", "author": "Roger Qiu", "description": "Org wide custom eslint rules", "license": "Apache-2.0",