File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ import Gitdown from 'gitdown';
77import glob from 'glob' ;
88import _ from 'lodash' ;
99
10+ const removeReadmeIgnores = ( { ignoreReadme} ) => {
11+ return ! ignoreReadme ;
12+ } ;
13+
1014const trimCode = ( code ) => {
1115 let lines = code . replace ( / ^ \n / u, '' ) . trimEnd ( ) . split ( '\n' ) ;
1216
@@ -59,8 +63,8 @@ const getAssertions = () => {
5963 const codes = require ( filePath ) ;
6064
6165 return {
62- invalid : _ . map ( codes . invalid , formatCodeSnippet ) ,
63- valid : _ . map ( codes . valid , formatCodeSnippet ) ,
66+ invalid : codes . invalid . filter ( removeReadmeIgnores ) . map ( formatCodeSnippet ) ,
67+ valid : codes . valid . filter ( removeReadmeIgnores ) . map ( formatCodeSnippet ) ,
6468 } ;
6569 } ) ;
6670
Original file line number Diff line number Diff line change @@ -74,12 +74,14 @@ const ruleTester = new RuleTester();
7474 }
7575
7676 assertions . invalid = assertions . invalid . map ( ( assertion ) => {
77+ Reflect . deleteProperty ( assertion , 'ignoreReadme' ) ;
7778 assertion . parserOptions = _ . defaultsDeep ( assertion . parserOptions , parserOptions ) ;
7879
7980 return assertion ;
8081 } ) ;
8182
8283 assertions . valid = assertions . valid . map ( ( assertion ) => {
84+ Reflect . deleteProperty ( assertion , 'ignoreReadme' ) ;
8385 if ( assertion . errors ) {
8486 throw new Error ( `Valid assertions for rule ${ ruleName } should not have an \`errors\` array.` ) ;
8587 }
You can’t perform that action at this time.
0 commit comments