2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Updated migration eslint rule to catch bad filenames

- We had an incident where a migration file was misnamed.
- This is caused by using slimer with spaces rather than hyphens
- We didn't imagine this case when writing the regex for matching filenames
- However, now we know it, it's easy to tweak the regex to match this case
- This requires adding an override to the one badly named file
This commit is contained in:
Hannah Wolfe 2022-04-05 11:49:13 +01:00
parent aeea3a3d76
commit ac32944dc6
No known key found for this signature in database
GPG key ID: AB586C3B5AE5C037
2 changed files with 6 additions and 1 deletions

View file

@ -30,7 +30,7 @@ module.exports = {
'core/server/data/migrations/versions/3.*/*'
],
rules: {
'ghost/filenames/match-regex': ['error', '^(?:\\d{2}|\\d{4}(?:-\\d{2}){4})(?:-[a-zA-Z]+)+$', true]
'ghost/filenames/match-regex': ['error', '^(?:\\d{2}|\\d{4}(?:-\\d{2}){4})(?:-[a-zA-Z]+){2,}$', true]
}
},
{

View file

@ -1,3 +1,8 @@
// ESLint Override Notice
// This file was named incorrectly and it didn't flag up in our eslint rules.
// The ESLint match-regex rule has now been updated to catch this, but this file has to be excluded.
/* eslint-disable ghost/filenames/match-regex */
const {addTable} = require('../../utils');
module.exports = addTable('newsletters', {