@@ -12,7 +12,7 @@ module.exports = {
1212 mocha : true ,
1313 es2024 : true ,
1414 } ,
15- plugins : [ '@typescript-eslint' , 'unicorn' , 'header' , 'security-node' , 'aws-toolkits' ] ,
15+ plugins : [ '@typescript-eslint' , '@stylistic' , ' unicorn', 'header' , 'security-node' , 'aws-toolkits' ] ,
1616 extends : [
1717 'eslint:recommended' ,
1818 'plugin:@typescript-eslint/eslint-recommended' ,
@@ -113,6 +113,20 @@ module.exports = {
113113 'no-constant-condition' : [ 'error' , { checkLoops : false } ] ,
114114 'no-empty' : 'off' ,
115115
116+ // https://eslint.style/rules/default/spaced-comment
117+ // Require space after // comment.
118+ '@stylistic/spaced-comment' : [
119+ 'error' ,
120+ 'always' ,
121+ {
122+ block : {
123+ markers : [ '!' ] , // Allow the /*!…*/ license header.
124+ // exceptions: ['*'],
125+ // balanced: true
126+ } ,
127+ } ,
128+ ] ,
129+
116130 // Rules from https://github.com/sindresorhus/eslint-plugin-unicorn
117131 // TODO: 'unicorn/no-useless-promise-resolve-reject': 'error',
118132 // TODO: 'unicorn/prefer-at': 'error',
@@ -162,7 +176,8 @@ module.exports = {
162176 'aws-toolkits/no-incorrect-once-usage' : 'error' ,
163177 'aws-toolkits/no-string-exec-for-child-process' : 'error' ,
164178 'aws-toolkits/no-console-log' : 'error' ,
165-
179+ 'aws-toolkits/no-json-stringify-in-log' : 'error' ,
180+ 'aws-toolkits/no-printf-mismatch' : 'error' ,
166181 'no-restricted-imports' : [
167182 'error' ,
168183 {
@@ -173,13 +188,24 @@ module.exports = {
173188 "Avoid importing from the core lib's dist/ folders; please use directly from the core lib defined exports." ,
174189 } ,
175190 ] ,
191+ // The following will place an error on the `fs-extra` import since we do not want it to be used for browser compatibility reasons.
192+ paths : [
193+ {
194+ name : 'fs-extra' ,
195+ message :
196+ 'Avoid fs-extra, use shared/fs/fs.ts. Notify the Toolkit team if your required functionality is not available.' ,
197+ } ,
198+ {
199+ name : 'fs' ,
200+ message : 'Avoid node:fs and use shared/fs/fs.ts when possible.' ,
201+ } ,
202+ {
203+ name : 'child_process' ,
204+ message :
205+ 'Avoid child_process, use ChildProcess from `shared/utilities/processUtils.ts` instead.' ,
206+ } ,
207+ ] ,
176208 } ,
177- // The following will place an error on the `fs-extra` import since we do not want it to be used for browser compatibility reasons.
178- // {
179- // name: 'fs-extra',
180- // message:
181- // 'Avoid fs-extra, use shared/fs/fs.ts. Notify the Toolkit team if your required functionality is not available.',
182- // },
183209 ] ,
184210 } ,
185211}
0 commit comments