Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/common-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- name: Install Packages
run: npm install

- name: Run ESLint
run: npm run eslint

- name: Run Tests
env:
SA_WITHOUT_CONTEXT: ${{ secrets.SA_WITHOUT_CONTEXT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '20.x'
registry-url: "https://registry.npmjs.org"
# registry-url: "https://registry.npmjs.org"

- name: Install Packages
run: npm install
Expand Down
53 changes: 53 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import tseslint from 'typescript-eslint';
export default tseslint.config(

{
files: ["**/*.{js,mjs,cjs,ts}"],

languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectSource: true,
tsconfigRootDir: import.meta.dirname,
sourceType: "module",
},
},

linterOptions: {
reportUnusedDisableDirectives: "off"
},
plugins: {
"@typescript-eslint": tseslint.plugin,
},
rules: {
"camelcase": ["error", { "properties": "never", "ignoreImports": true }],
"dot-notation": "off",
"no-restricted-syntax": [
"error",
{
// Bans obj['key'] in favor of obj.key
selector: "MemberExpression[computed=true] > Literal[value=/./]",
message: "Do not use string literals for object access. Use dot notation (obj.prop) or constants.",
},
{
// Bans comparison against magic strings, excluding type names
selector: "BinaryExpression[operator=/^(==|===|!=|!==)$/] > Literal[value=/^(?!(string|number|boolean|object|undefined|{})$).+/]",
message: "Do not compare against magic strings. Use constants instead."
}
],
},

}
,
{
ignores: [
"node_modules/",
"dist/",
"coverage/",
"src/ _generated_/",
"test/**",
"samples/**",
"scripts/**",
]
}
);
Loading
Loading