1+ import deprecate from "eslint-plugin-deprecate" ;
2+ import mozilla from "eslint-plugin-mozilla" ;
3+ import globals from "globals" ;
4+ import path from "node:path" ;
5+ import { fileURLToPath } from "node:url" ;
6+ import js from "@eslint/js" ;
7+ import { FlatCompat } from "@eslint/eslintrc" ;
8+
9+ const __filename = fileURLToPath ( import . meta. url ) ;
10+ const __dirname = path . dirname ( __filename ) ;
11+ const compat = new FlatCompat ( {
12+ baseDirectory : __dirname ,
13+ recommendedConfig : js . configs . recommended ,
14+ allConfig : js . configs . all
15+ } ) ;
16+
17+ export default [ ...compat . extends ( "eslint:recommended" , "plugin:mozilla/recommended" ) , {
18+ plugins : {
19+ deprecate,
20+ mozilla,
21+ } ,
22+
23+ languageOptions : {
24+ globals : {
25+ ...globals . browser ,
26+ ...mozilla . environments . jsm . globals ,
27+ ...globals . commonjs ,
28+ EXPORTED_SYMBOLS : "readonly" ,
29+ ChromeUtils : "readonly" ,
30+ XPCOMUtils : "readonly" ,
31+ sizeToContent : "readonly" ,
32+ Cc : "readonly" ,
33+ Cu : "readonly" ,
34+ Ci : "readonly" ,
35+ Cr : "readonly" ,
36+ browser : "readonly" ,
37+ messenger : "readonly" ,
38+ ExtensionCommon : "readonly" ,
39+ MailServices : "readonly" ,
40+ gTabmail : "readonly" ,
41+ OS : "readonly" ,
42+ window : "readonly" ,
43+ msgWindow : "readonly" ,
44+ gFolderDisplay : "readonly" ,
45+ IOUtils : "readonly" ,
46+ PathUtils : "readonly" ,
47+ globalThis : "readonly" ,
48+ BatchMessageMover : "readonly" ,
49+ } ,
50+
51+ ecmaVersion : 5 ,
52+ sourceType : "module" ,
53+ } ,
54+
55+ rules : {
56+ "no-irregular-whitespace" : "error" ,
57+ "space-in-parens" : "error" ,
58+ "no-unused-vars" : "off" ,
59+ "space-before-function-paren" : "off" ,
60+ "no-array-constructor" : "warn" ,
61+ "no-octal" : "off" ,
62+ "mozilla/import-globals" : "off" ,
63+ "no-tabs" : "off" ,
64+ "no-useless-return" : "off" ,
65+ "object-shorthand" : "off" ,
66+ "padded-blocks" : "off" ,
67+ "mozilla/use-cc-etc" : "error" ,
68+ "mozilla/no-useless-parameters" : "off" ,
69+ "mozilla/use-services" : "off" ,
70+ "mozilla/use-includes-instead-of-indexOf" : "warn" ,
71+ "mozilla/avoid-removeChild" : "warn" ,
72+ "mozilla/use-chromeutils-generateqi" : "off" ,
73+ quotes : "off" ,
74+ semi : "error" ,
75+
76+ complexity : [ "error" , {
77+ max : 80 ,
78+ } ] ,
79+
80+ "no-restricted-properties" : [ 1 , {
81+ property : "nsIStringBundleService" ,
82+ } ] ,
83+
84+ "deprecate/function" : [ "error" , {
85+ name : "createBundle" ,
86+ use : "Replace with Services.createBundle" ,
87+ } ] ,
88+ } ,
89+ } , {
90+ files : [ "./src/chrome/content/*.js" ] ,
91+ } ] ;
0 commit comments