11module . exports = {
2- plugins : [
3- "matrix-org" ,
4- "import" ,
5- "jsdoc" ,
6- ] ,
7- extends : [
8- "plugin:matrix-org/babel" ,
9- "plugin:import/typescript" ,
10- ] ,
2+ plugins : [ "matrix-org" , "import" , "jsdoc" ] ,
3+ extends : [ "plugin:matrix-org/babel" , "plugin:import/typescript" ] ,
114 env : {
125 browser : true ,
136 node : true ,
@@ -28,92 +21,95 @@ module.exports = {
2821 "padded-blocks" : [ "error" ] ,
2922 "no-extend-native" : [ "error" ] ,
3023 "camelcase" : [ "error" ] ,
31- "no-multi-spaces" : [ "error" , { "ignoreEOLComments" : true } ] ,
32- "space-before-function-paren" : [ "error" , {
33- "anonymous" : "never" ,
34- "named" : "never" ,
35- "asyncArrow" : "always" ,
36- } ] ,
24+ "no-multi-spaces" : [ "error" , { ignoreEOLComments : true } ] ,
25+ "space-before-function-paren" : [
26+ "error" ,
27+ {
28+ anonymous : "never" ,
29+ named : "never" ,
30+ asyncArrow : "always" ,
31+ } ,
32+ ] ,
3733 "arrow-parens" : "off" ,
3834 "prefer-promise-reject-errors" : "off" ,
39- "quotes" : "off" ,
40- "indent" : "off" ,
4135 "no-constant-condition" : "off" ,
4236 "no-async-promise-executor" : "off" ,
4337 // We use a `logger` intermediary module
4438 "no-console" : "error" ,
4539
4640 // restrict EventEmitters to force callers to use TypedEventEmitter
47- "no-restricted-imports" : [ "error" , {
48- name : "events" ,
49- message : "Please use TypedEventEmitter instead" ,
50- } ] ,
51-
52- "import/no-restricted-paths" : [ "error" , {
53- "zones" : [ {
54- "target" : "./src/" ,
55- "from" : "./src/index.ts" ,
56- "message" : "The package index is dynamic between src and lib depending on " +
57- "whether release or development, target the specific module or matrix.ts instead" ,
58- } ] ,
59- } ] ,
60- } ,
61- overrides : [ {
62- files : [
63- "**/*.ts" ,
64- ] ,
65- plugins : [
66- "eslint-plugin-tsdoc" ,
41+ "no-restricted-imports" : [
42+ "error" ,
43+ {
44+ name : "events" ,
45+ message : "Please use TypedEventEmitter instead" ,
46+ } ,
6747 ] ,
68- extends : [
69- "plugin:matrix-org/typescript" ,
70- ] ,
71- rules : {
72- // TypeScript has its own version of this
73- "@babel/no-invalid-this" : "off" ,
7448
75- // We're okay being explicit at the moment
76- "@typescript-eslint/no-empty-interface" : "off" ,
77- // We disable this while we're transitioning
78- "@typescript-eslint/no-explicit-any" : "off" ,
79- // We'd rather not do this but we do
80- "@typescript-eslint/ban-ts-comment" : "off" ,
81- // We're okay with assertion errors when we ask for them
82- "@typescript-eslint/no-non-null-assertion" : "off" ,
49+ "import/no-restricted-paths" : [
50+ "error" ,
51+ {
52+ zones : [
53+ {
54+ target : "./src/" ,
55+ from : "./src/index.ts" ,
56+ message :
57+ "The package index is dynamic between src and lib depending on " +
58+ "whether release or development, target the specific module or matrix.ts instead" ,
59+ } ,
60+ ] ,
61+ } ,
62+ ] ,
63+ } ,
64+ overrides : [
65+ {
66+ files : [ "**/*.ts" ] ,
67+ plugins : [ "eslint-plugin-tsdoc" ] ,
68+ extends : [ "plugin:matrix-org/typescript" ] ,
69+ rules : {
70+ // TypeScript has its own version of this
71+ "@babel/no-invalid-this" : "off" ,
8372
84- // The non-TypeScript rule produces false positives
85- "func-call-spacing" : "off" ,
86- "@typescript-eslint/func-call-spacing" : [ "error" ] ,
73+ // We're okay being explicit at the moment
74+ "@typescript-eslint/no-empty-interface" : "off" ,
75+ // We disable this while we're transitioning
76+ "@typescript-eslint/no-explicit-any" : "off" ,
77+ // We'd rather not do this but we do
78+ "@typescript-eslint/ban-ts-comment" : "off" ,
79+ // We're okay with assertion errors when we ask for them
80+ "@typescript-eslint/no-non-null-assertion" : "off" ,
8781
88- "quotes" : "off" ,
89- // We use a `logger` intermediary module
90- "no-console " : "error" ,
82+ // The non-TypeScript rule produces false positives
83+ "func-call-spacing" : "off" ,
84+ "@typescript-eslint/func-call-spacing " : [ "error" ] ,
9185
86+ "quotes" : "off" ,
87+ // We use a `logger` intermediary module
88+ "no-console" : "error" ,
89+ } ,
9290 } ,
93- } , {
94- // We don't need amazing docs in our spec files
95- files : [
96- "src/**/*.ts" ,
97- ] ,
98- rules : {
99- "tsdoc/syntax" : "error" ,
100- // We use some select jsdoc rules as the tsdoc linter has only one rule
101- "jsdoc/no-types" : "error" ,
102- "jsdoc/empty-tags" : "error" ,
103- "jsdoc/check-property-names" : "error" ,
104- "jsdoc/check-values" : "error" ,
105- // These need a bit more work before we can enable
106- // "jsdoc/check-param-names": "error",
107- // "jsdoc/check-indentation": "error",
91+ {
92+ // We don't need amazing docs in our spec files
93+ files : [ "src/**/*.ts" ] ,
94+ rules : {
95+ "tsdoc/syntax" : "error" ,
96+ // We use some select jsdoc rules as the tsdoc linter has only one rule
97+ "jsdoc/no-types" : "error" ,
98+ "jsdoc/empty-tags" : "error" ,
99+ "jsdoc/check-property-names" : "error" ,
100+ "jsdoc/check-values" : "error" ,
101+ // These need a bit more work before we can enable
102+ // "jsdoc/check-param-names": "error",
103+ // "jsdoc/check-indentation": "error",
104+ } ,
108105 } ,
109- } , {
110- files : [
111- "spec/**/*.ts" ,
112- ] ,
113- rules : {
114- // We don't need super strict typing in test utilities
115- "@typescript-eslint/explicit-function-return-type" : "off" ,
116- "@typescript-eslint/explicit-member-accessibility" : "off" ,
106+ {
107+ files : [ "spec/**/*.ts" ] ,
108+ rules : {
109+ // We don't need super strict typing in test utilities
110+ "@typescript-eslint/explicit-function-return-type" : "off" ,
111+ "@typescript-eslint/explicit-member-accessibility" : "off" ,
112+ } ,
117113 } ,
118- } ] ,
114+ ] ,
119115} ;
0 commit comments