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,12 +21,15 @@ 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" ,
3935 "no-constant-condition" : "off" ,
@@ -42,76 +38,78 @@ module.exports = {
4238 "no-console" : "error" ,
4339
4440 // restrict EventEmitters to force callers to use TypedEventEmitter
45- "no-restricted-imports" : [ "error" , {
46- name : "events" ,
47- message : "Please use TypedEventEmitter instead" ,
48- } ] ,
49-
50- "import/no-restricted-paths" : [ "error" , {
51- "zones" : [ {
52- "target" : "./src/" ,
53- "from" : "./src/index.ts" ,
54- "message" : "The package index is dynamic between src and lib depending on " +
55- "whether release or development, target the specific module or matrix.ts instead" ,
56- } ] ,
57- } ] ,
58- } ,
59- overrides : [ {
60- files : [
61- "**/*.ts" ,
62- ] ,
63- plugins : [
64- "eslint-plugin-tsdoc" ,
41+ "no-restricted-imports" : [
42+ "error" ,
43+ {
44+ name : "events" ,
45+ message : "Please use TypedEventEmitter instead" ,
46+ } ,
6547 ] ,
66- extends : [
67- "plugin:matrix-org/typescript" ,
68- ] ,
69- rules : {
70- // TypeScript has its own version of this
71- "@babel/no-invalid-this" : "off" ,
7248
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" ,
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" ,
8172
82- // The non-TypeScript rule produces false positives
83- "func-call-spacing" : "off" ,
84- "@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" ,
8581
86- "quotes" : "off" ,
87- // We use a `logger` intermediary module
88- "no-console " : "error" ,
82+ // The non-TypeScript rule produces false positives
83+ "func-call-spacing" : "off" ,
84+ "@typescript-eslint/func-call-spacing " : [ "error" ] ,
8985
86+ "quotes" : "off" ,
87+ // We use a `logger` intermediary module
88+ "no-console" : "error" ,
89+ } ,
9090 } ,
91- } , {
92- // We don't need amazing docs in our spec files
93- files : [
94- "src/**/*.ts" ,
95- ] ,
96- rules : {
97- "tsdoc/syntax" : "error" ,
98- // We use some select jsdoc rules as the tsdoc linter has only one rule
99- "jsdoc/no-types" : "error" ,
100- "jsdoc/empty-tags" : "error" ,
101- "jsdoc/check-property-names" : "error" ,
102- "jsdoc/check-values" : "error" ,
103- // These need a bit more work before we can enable
104- // "jsdoc/check-param-names": "error",
105- // "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+ } ,
106105 } ,
107- } , {
108- files : [
109- "spec/**/*.ts" ,
110- ] ,
111- rules : {
112- // We don't need super strict typing in test utilities
113- "@typescript-eslint/explicit-function-return-type" : "off" ,
114- "@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+ } ,
115113 } ,
116- } ] ,
114+ ] ,
117115} ;
0 commit comments