5
5
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6
6
*/
7
7
8
- import eslint from "@eslint/js" ;
9
- import tseslint from "typescript-eslint" ;
8
+ import globals from "globals" ;
9
+ import js from "@eslint/js" ;
10
+ import nodePlugin from "eslint-plugin-n" ;
11
+ import tseslintPlugin from "@typescript-eslint/eslint-plugin" ;
12
+ import tseslintParser from "@typescript-eslint/parser" ;
10
13
11
- export default tseslint . config (
12
- eslint . configs . recommended ,
13
- ...tseslint . configs . recommended
14
- ) ;
14
+ export default [
15
+ {
16
+ files : [ "src/**/*.ts" , "src/**/*.tsx" ] ,
17
+ languageOptions : {
18
+ ecmaVersion : 2022 ,
19
+ sourceType : "module" ,
20
+ parser : tseslintParser ,
21
+ parserOptions : {
22
+ ecmaFeatures : {
23
+ modules : true
24
+ } ,
25
+ ecmaVersion : "2022" ,
26
+ project : "./tsconfig.json" ,
27
+ } ,
28
+ globals : {
29
+ ...globals . browser ,
30
+ }
31
+ } ,
32
+ plugins : {
33
+ "@typescript-eslint" : tseslintPlugin
34
+ } ,
35
+ rules : {
36
+ ...js . configs . recommended . rules ,
37
+ ...tseslintPlugin . configs [ "eslint-recommended" ] . overrides [ 0 ] . rules ,
38
+ ...tseslintPlugin . configs [ "recommended" ] . rules ,
39
+ "@typescript-eslint/no-require-imports" : "off" ,
40
+ "@typescript-eslint/no-unused-vars" : "warn" ,
41
+ "prefer-const" : "warn" ,
42
+ }
43
+ } ,
44
+ {
45
+ files : [ "src/**/*.js" ] ,
46
+ languageOptions : {
47
+ ecmaVersion : 2022 ,
48
+ sourceType : "module" ,
49
+ globals : {
50
+ ...globals . browser ,
51
+ ...globals . amd
52
+ }
53
+ } ,
54
+ rules : {
55
+ ...js . configs . recommended . rules ,
56
+ "no-undef" : "warn"
57
+ }
58
+ } ,
59
+ {
60
+ files : [ "server/**/*.js" , "server/**/*.cjs" ] ,
61
+ languageOptions : {
62
+ ecmaVersion : 2022 ,
63
+ sourceType : "module" ,
64
+ globals : {
65
+ ...globals . node ,
66
+ }
67
+ } ,
68
+ plugins : {
69
+ n : nodePlugin
70
+ } ,
71
+ rules : {
72
+ ...js . configs . recommended . rules ,
73
+ ...nodePlugin . configs [ "flat/recommended-script" ] . rules
74
+ }
75
+ }
76
+ ] ;
0 commit comments