Skip to content

Commit

Permalink
feat: add publish key
Browse files Browse the repository at this point in the history
  • Loading branch information
eyea committed Nov 10, 2023
2 parents 4fa0bbe + 8d55058 commit 523b593
Show file tree
Hide file tree
Showing 11 changed files with 10,405 additions and 5,551 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";

module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:eslint-plugin/recommended",
"plugin:node/recommended",
],
env: {
node: true,
},
};
12 changes: 7 additions & 5 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Node.js Package

on:
release:
types: [created]
push:
branches:
- main

jobs:
build:
Expand All @@ -13,7 +14,7 @@ jobs:
with:
node-version: 16
- run: npm ci
- run: npm test
# - run: npm test

publish-gpr:
needs: build
Expand All @@ -26,8 +27,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
registry-url: https://registry.npmjs.org
scope: '@afuteam'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.AFUTEAM_LINT_PUBLISH_NPM_TOKEN}}
6 changes: 5 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# registry=https://registry.npmjs.org/
# @eyea:registry=https://npm.pkg.github.com

//registry.npmjs.org/:_authToken=${AFUTEAM_LINT_PUBLISH_NPM_TOKEN}
registry=https://registry.npmjs.org/
@eyea:registry=https://npm.pkg.github.com
always-auth=true
1 change: 0 additions & 1 deletion index.js

This file was deleted.

66 changes: 66 additions & 0 deletions lib/configs/js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Basic: Eslint/JavaScript Version: 1.0.0

module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
es2021: true,
},
globals: {
AHAPP: 'readonly',
AHJavascriptBridge: 'readonly',
trackPageView: 'readonly',
trackCustomEvent: 'readonly',
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
// 继承的规则 [扩展]
extends: [
'eslint:recommended'
],
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
ignorePatterns: ['*.min.*'],
rules: {
// JavaScript Basic rules, 35条 使用afu的rules,和eslint/recommended搭配
'no-multi-spaces': 2,
'no-unused-vars': 1, // 非TS项目,此项需设为1
'no-undef': 0,
'no-empty-function': 2,
'no-shadow': 2,
'curly': 2,
'array-callback-return': 2,
'block-scoped-var': 2,
'default-case': 2,
'complexity': ['error', { 'max': 20 }],
'no-console': 0,
'no-await-in-loop': 2,
'no-mixed-spaces-and-tabs': 0,
'no-prototype-builtins': 0,
'no-useless-escape': 0,
'no-self-assign': 0,
'no-caller': 2,
'no-div-regex': 2,
'no-floating-decimal': 2,
'no-new-wrappers': 2,
'no-return-assign': 2,
'no-unmodified-loop-condition': 2,
'require-await': 2,
'wrap-iife': 1,
'require-atomic-updates': 2,
'no-empty': 2,
'no-case-declarations': 2,
// 追加的几条规则
'no-use-before-define': 0, // 未定义前不能使用
'no-new': 0,
'new-cap': 0,
'global-require': 0,
'consistent-return': 0, // return 后面是否允许省略
'no-underscore-dangle': 0, // 标识符不能以_开头或结尾;如果使用react的规则的话,我们有这个规则
'no-unused-expressions': 1, // 禁止无用的表达式
},
}
Loading

0 comments on commit 523b593

Please sign in to comment.