refactor: update eslint
This commit is contained in:
Родитель
9ff595b366
Коммит
935980eedf
11
.eslintrc
11
.eslintrc
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"extends": "eslint:recommended",
|
||||
"parser": "babel-eslint",
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest"
|
||||
},
|
||||
"rules": {
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ var SRError = require('@semantic-release/error')
|
|||
module.exports = function (pluginConfig, config, cb) {
|
||||
var env = config.env
|
||||
|
||||
if (!env.hasOwnProperty('GITHUB_ACTION')) {
|
||||
if (!Object.hasOwnProperty.call(env, 'GITHUB_ACTION')) {
|
||||
return cb(new SRError(
|
||||
'semantic-release didn’t run on Github Action and therefore a new version won’t be published.\n' +
|
||||
'You can customize this behavior using "verifyConditions" plugins: git.io/sr-plugins',
|
||||
|
|
|
@ -34,10 +34,8 @@
|
|||
"author": "Telerik",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@telerik/eslint-config": "1.1.0",
|
||||
"babel-eslint": "^7.2.3",
|
||||
"cz-conventional-changelog": "^1.1.5",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint": "^8.16.0",
|
||||
"validate-commit-msg": "^1.1.1"
|
||||
},
|
||||
"config": {
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = function (pluginConfig, config, cb) {
|
|||
if (config.nextRelease) {
|
||||
// change version suffix of pre-releases from '-number' to '-tag.timestamp'
|
||||
const now = new Date();
|
||||
const timestamp = now.toISOString().replace(/[\-T\:]/g, "").slice(0,12);
|
||||
const timestamp = now.toISOString().replace(/[-T:]/g, "").slice(0,12);
|
||||
const suffix = `-${config.npm.tag}.${timestamp}`;
|
||||
const release = config.nextRelease;
|
||||
|
||||
|
@ -10,7 +10,7 @@ module.exports = function (pluginConfig, config, cb) {
|
|||
// start releases with 0.1.0 instead of 1.0.0
|
||||
release.version = '0.1.0';
|
||||
} else {
|
||||
release.version = release.version.replace(/\-.+$/, suffix);
|
||||
release.version = release.version.replace(/-.+$/, suffix);
|
||||
}
|
||||
|
||||
console.log(`Ready for release v${release.version}`);
|
||||
|
|
Загрузка…
Ссылка в новой задаче