chore: replace deprecated String.prototype.substr() ()

* chore: replace deprecated String.prototype.substr()

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

* refactor: add prefer slice lint rule and fix errors

Co-authored-by: erezrokah <erezrokah@users.noreply.github.com>
This commit is contained in:
CommanderRoot
2022-03-28 19:29:56 +02:00
committed by GitHub
parent de624a9c11
commit 59b9348093
20 changed files with 157 additions and 106 deletions
.eslintrc.js
dev-test
package.json
packages
netlify-cms-backend-azure/src
netlify-cms-backend-github/src
netlify-cms-core/src
netlify-cms-lib-util/src
netlify-cms-lib-widgets/src
netlify-cms-proxy-server/src/middlewares/utils
netlify-cms-widget-file/src
netlify-cms-widget-markdown/src/serializers
scripts
yarn.lock

@ -51,8 +51,9 @@ module.exports = {
destructuring: 'all',
},
],
'unicorn/prefer-string-slice': 'error',
},
plugins: ['babel', '@emotion', 'cypress'],
plugins: ['babel', '@emotion', 'cypress', 'unicorn'],
settings: {
react: {
version: 'detect',