Skip to content

Commit b3e9c42

Browse files
wip: terraform
1 parent c7b4b1d commit b3e9c42

File tree

4 files changed

+62
-145
lines changed

4 files changed

+62
-145
lines changed

__tests__/assert.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ describe('Assert', () => {
5252
expect(assert(false, 'not a number')).toBeTruthy()
5353
expect(false).toBeTruthy()
5454
}
55-
catch (e) {
56-
expect(e instanceof FoundationError).toBeTruthy()
57-
expect(e instanceof AssertError).toBeTruthy()
55+
catch (err) {
56+
expect(err instanceof FoundationError).toBeTruthy()
57+
expect(err instanceof AssertError).toBeTruthy()
5858

59-
if (e instanceof AssertError) {
60-
expect(e.name).toBe('AssertError')
61-
expect(e.message).toBe('not a number')
59+
if (err instanceof AssertError) {
60+
expect(err.name).toBe('AssertError')
61+
expect(err.message).toBe('not a number')
6262
}
6363
}
6464
})

eslint.config.js

Lines changed: 48 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,55 @@
1-
import eslintPlugin from '@typescript-eslint/eslint-plugin'
2-
import eslintParser from '@typescript-eslint/parser'
3-
import importPlugin from 'eslint-plugin-import'
1+
import eslint from "@eslint/js"
2+
import globals from "globals"
3+
import typescriptEslint from "typescript-eslint"
4+
import stylisticJsPlugin from "@stylistic/eslint-plugin-js"
45

5-
export default [
6+
export default typescriptEslint.config(
7+
{ ignores: ["**/*.d.ts", "**/coverage", "**/dist"] },
68
{
7-
files: [ '**/*.{js,ts}' ], // Apply to JavaScript and TypeScript files
8-
ignores: [ 'node_modules', 'dist' ], // Replace .eslintignore contents
9+
extends: [
10+
eslint.configs.recommended,
11+
...typescriptEslint.configs.recommended,
12+
],
13+
files: ["**/*.{ts}"],
914
languageOptions: {
10-
ecmaVersion: 2021,
11-
sourceType: 'module',
12-
parser: eslintParser,
13-
},
14-
plugins: {
15-
'@typescript-eslint': eslintPlugin,
16-
import: importPlugin,
17-
},
18-
settings: {
19-
'import/resolver': {
20-
typescript: {
21-
// Resolve using tsconfig.json
22-
project: './tsconfig.json',
23-
},
15+
ecmaVersion: "latest",
16+
sourceType: "module",
17+
globals: globals.browser,
18+
parserOptions: {
19+
parser: typescriptEslint.parser,
2420
},
2521
},
2622
rules: {
27-
'@typescript-eslint/no-inferrable-types': 'off',
28-
'@typescript-eslint/explicit-function-return-type': 'off',
29-
'@typescript-eslint/no-empty-interface': 'error',
30-
'@typescript-eslint/no-explicit-any': 'warn',
31-
'@typescript-eslint/explicit-module-boundary-types': 'error',
32-
'@typescript-eslint/no-unused-vars': [
33-
'error',
34-
{
35-
argsIgnorePattern: '^_',
36-
varsIgnorePattern: '^_',
37-
}
38-
],
39-
eqeqeq: 'error',
40-
camelcase: 'error',
41-
'no-console': 'error',
42-
'no-lonely-if': 'error',
43-
'comma-dangle': [
44-
'error',
45-
{
46-
arrays: 'never',
47-
objects: 'always-multiline',
48-
imports: 'always-multiline',
49-
exports: 'always-multiline',
50-
functions: 'never',
51-
}
52-
],
53-
indent: [ 'error', 4, { SwitchCase: 1 } ],
54-
'no-tabs': 'error',
55-
'object-curly-spacing': [ 'error', 'always' ],
56-
'array-bracket-spacing': [ 'error', 'always' ],
57-
curly: [ 'error', 'all' ],
58-
'template-curly-spacing': 'error',
59-
'no-trailing-spaces': 'error',
60-
'space-before-blocks': 'error',
61-
semi: [ 'error', 'never' ],
62-
quotes: [ 'error', 'single', { avoidEscape: true } ],
63-
'object-curly-newline': [
64-
'error',
65-
{
66-
multiline: true,
67-
minProperties: 2,
68-
consistent: true,
69-
}
70-
],
71-
'object-property-newline': [
72-
'error',
73-
{
74-
allowAllPropertiesOnSameLine: true,
75-
}
76-
],
77-
'object-shorthand': 'error',
78-
'no-param-reassign': [ 'error', { props: false } ],
79-
'no-extra-parens': 'error',
80-
'no-return-await': 'error',
81-
'no-self-compare': 'error',
82-
'no-template-curly-in-string': 'error',
83-
'no-throw-literal': 'error',
84-
'no-undef-init': 'error',
85-
'no-unmodified-loop-condition': 'error',
86-
'no-unneeded-ternary': 'error',
87-
'no-unreachable-loop': 'error',
88-
'no-unsafe-optional-chaining': 'error',
89-
'no-unused-expressions': 'error',
90-
'no-use-before-define': [
91-
'error',
92-
{
93-
functions: false, classes: true, variables: true,
94-
}
95-
],
96-
'no-useless-backreference': 'error',
97-
'no-useless-call': 'error',
98-
'no-useless-computed-key': 'error',
99-
'no-useless-concat': 'error',
100-
'no-useless-constructor': 'error',
101-
'no-useless-rename': 'error',
102-
'no-useless-return': 'error',
103-
'no-var': 'error',
104-
'nonblock-statement-body-position': 'error',
105-
'one-var-declaration-per-line': 'error',
106-
'prefer-arrow-callback': 'error',
107-
'prefer-const': 'error',
108-
'prefer-exponentiation-operator': 'error',
109-
'prefer-numeric-literals': 'error',
110-
'prefer-object-spread': 'error',
111-
'prefer-promise-reject-errors': 'error',
112-
'prefer-template': 'error',
113-
'prefer-rest-params': 'error',
114-
'rest-spread-spacing': 'error',
115-
'require-atomic-updates': 'error',
116-
'require-await': 'error',
117-
'import/order': [
118-
'error',
119-
{
120-
groups: [
121-
'builtin',
122-
'external',
123-
'internal',
124-
'parent',
125-
'sibling',
126-
'index'
127-
],
128-
alphabetize: {
129-
order: 'asc',
130-
caseInsensitive: true,
131-
},
132-
}
133-
],
23+
"@stylistic/js/semi": ["error", "never"],
24+
"@stylistic/js/block-spacing": ["error", "always"],
25+
"@stylistic/js/comma-dangle": ["error", {
26+
"arrays": "never",
27+
"objects": "always-multiline",
28+
"imports": "always-multiline",
29+
"exports": "always-multiline",
30+
"functions": "never",
31+
}],
32+
"@stylistic/js/indent": ["error", 4, { SwitchCase: 1 }],
33+
34+
// Spacing rules
35+
"@stylistic/js/object-curly-spacing": ["error", "always"],
36+
"@stylistic/js/array-bracket-spacing": ["error", "never"],
37+
"@stylistic/js/space-in-parens": ["error", "never"],
38+
"@stylistic/js/space-infix-ops": ["error"],
39+
40+
// Line rules
41+
"@stylistic/js/eol-last": ["error", "always"],
42+
"@stylistic/js/no-trailing-spaces": ["error"],
43+
"@stylistic/js/max-len": ["error", { "code": 255 }],
44+
45+
// Other formatting rules
46+
"@stylistic/js/quotes": ["error", "single"],
47+
"@stylistic/js/brace-style": ["error", "1tbs"],
48+
"@stylistic/js/arrow-spacing": ["error", { "before": true, "after": true }],
49+
"@stylistic/js/keyword-spacing": ["error", { "before": true, "after": true }],
50+
},
51+
plugins: {
52+
"@stylistic/js": stylisticJsPlugin, // Correct, explicit key-value entry.
13453
},
135-
}
136-
]
54+
},
55+
)

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
"dependencies": {
5353
"npm-run-all": "^4.1.5",
5454
"tslib": "^2.8.1",
55-
"typescript": "^5.8.2",
56-
"vite": "^6.2.1",
55+
"typescript": "^5.8.3",
56+
"vite": "^6.3.4",
5757
"vite-plugin-dts": "^4.5.3",
5858
"vitest": "^3.0.2"
5959
},
6060
"devDependencies": {
6161
"@microsoft/eslint-formatter-sarif": "^3.1.0",
62-
"@types/node": "^22.13.9",
63-
"@typescript-eslint/eslint-plugin": "^8.26.0",
64-
"@typescript-eslint/parser": "^8.26.0",
65-
"@vitest/coverage-v8": "^3.0.8",
66-
"eslint": "^9.21.0",
67-
"eslint-import-resolver-typescript": "^3.8.3",
62+
"@types/node": "^22.15.3",
63+
"@typescript-eslint/eslint-plugin": "^8.28.0",
64+
"@typescript-eslint/parser": "^8.28.0",
65+
"@vitest/coverage-v8": "^3.1.2",
66+
"eslint": "^9.26.0",
67+
"eslint-import-resolver-typescript": "^3.10.1",
6868
"eslint-plugin-import": "^2.31.0",
6969
"terser": "^5.39.0",
7070
"ts-node": "^10.9.2",

typings/env.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* Copyright © 2025, CosmicMind, Inc. */
2-
31
/// <reference types="vite/client" />
42

53
interface ImportMetaEnv {

0 commit comments

Comments
 (0)