Skip to content

Commit a0b504c

Browse files
chore(internal): codegen related update (#16)
1 parent 676a868 commit a0b504c

File tree

6 files changed

+310
-455
lines changed

6 files changed

+310
-455
lines changed

.eslintrc.js

-29
This file was deleted.

eslint.config.mjs

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// @ts-check
2+
import tseslint from 'typescript-eslint';
3+
import unusedImports from 'eslint-plugin-unused-imports';
4+
import prettier from 'eslint-plugin-prettier';
5+
6+
export default tseslint.config(
7+
{
8+
languageOptions: {
9+
parser: tseslint.parser,
10+
parserOptions: { sourceType: 'module' },
11+
},
12+
files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.js', '**/*.mjs', '**/*.cjs'],
13+
plugins: {
14+
'@typescript-eslint': tseslint.plugin,
15+
'unused-imports': unusedImports,
16+
prettier,
17+
},
18+
rules: {
19+
'no-unused-vars': 'off',
20+
'prettier/prettier': 'error',
21+
'unused-imports/no-unused-imports': 'error',
22+
'no-restricted-imports': [
23+
'error',
24+
{
25+
patterns: [
26+
{
27+
group: ['lightswitch-api', 'lightswitch-api/*'],
28+
message: 'Use a relative import, not a package import.',
29+
},
30+
],
31+
},
32+
],
33+
},
34+
},
35+
{
36+
files: ['tests/**', 'examples/**'],
37+
rules: {
38+
'no-restricted-imports': 'off',
39+
},
40+
},
41+
);

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
"@swc/jest": "^0.2.29",
3131
"@types/jest": "^29.4.0",
3232
"@types/node": "^20.17.6",
33-
"@typescript-eslint/eslint-plugin": "^6.7.0",
34-
"@typescript-eslint/parser": "^6.0.0",
35-
"eslint": "^8.49.0",
36-
"eslint-plugin-prettier": "^5.0.1",
37-
"eslint-plugin-unused-imports": "^3.0.0",
33+
"typescript-eslint": "^8.24.0",
34+
"@typescript-eslint/eslint-plugin": "^8.24.0",
35+
"@typescript-eslint/parser": "^8.24.0",
36+
"eslint": "^9.20.1",
37+
"eslint-plugin-prettier": "^5.2.3",
38+
"eslint-plugin-unused-imports": "^4.1.4",
3839
"iconv-lite": "^0.6.3",
3940
"jest": "^29.4.0",
4041
"prettier": "^3.0.0",

scripts/format

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -e
55
cd "$(dirname "$0")/.."
66

77
echo "==> Running eslint --fix"
8-
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --fix --ext ts,js .
8+
./node_modules/.bin/eslint --fix .

scripts/lint

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
cd "$(dirname "$0")/.."
66

77
echo "==> Running eslint"
8-
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js .
8+
./node_modules/.bin/eslint .
99

1010
echo "==> Building"
1111
./scripts/build # also checks types

0 commit comments

Comments
 (0)