Separate ESLint CI from Superlinter (#23029)
* Separate ESLint CI from Superlinter * Correct JS indenting level * Remove extra semicolons with ESLint autofix
This commit is contained in:
parent
9cdd643564
commit
d9088ef327
6 changed files with 52 additions and 14 deletions
40
.github/workflows/lint-js.yml
vendored
Normal file
40
.github/workflows/lint-js.yml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
name: JavaScript Linting
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- 'dependabot/**'
|
||||||
|
paths:
|
||||||
|
- 'package.json'
|
||||||
|
- 'yarn.lock'
|
||||||
|
- '.prettier*'
|
||||||
|
- '.eslint*'
|
||||||
|
- '**/*.js'
|
||||||
|
- '.github/workflows/lint-js.yml'
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'package.json'
|
||||||
|
- 'yarn.lock'
|
||||||
|
- '.prettier*'
|
||||||
|
- '.eslint*'
|
||||||
|
- '**/*.js'
|
||||||
|
- '.github/workflows/lint-js.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: yarn
|
||||||
|
|
||||||
|
- name: Install all yarn packages
|
||||||
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
|
- name: ESLint
|
||||||
|
run: yarn test:lint:js
|
2
.github/workflows/linter.yml
vendored
2
.github/workflows/linter.yml
vendored
|
@ -74,10 +74,8 @@ jobs:
|
||||||
DEFAULT_BRANCH: main
|
DEFAULT_BRANCH: main
|
||||||
NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360
|
NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js
|
|
||||||
LINTER_RULES_PATH: .
|
LINTER_RULES_PATH: .
|
||||||
RUBY_CONFIG_FILE: .rubocop.yml
|
RUBY_CONFIG_FILE: .rubocop.yml
|
||||||
VALIDATE_ALL_CODEBASE: false
|
VALIDATE_ALL_CODEBASE: false
|
||||||
VALIDATE_CSS: true
|
VALIDATE_CSS: true
|
||||||
VALIDATE_JAVASCRIPT_ES: true
|
|
||||||
VALIDATE_RUBY: true
|
VALIDATE_RUBY: true
|
||||||
|
|
|
@ -60,7 +60,7 @@ export function fetchFollowedHashtagsRequest() {
|
||||||
return {
|
return {
|
||||||
type: FOLLOWED_HASHTAGS_FETCH_REQUEST,
|
type: FOLLOWED_HASHTAGS_FETCH_REQUEST,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchFollowedHashtagsSuccess(followed_tags, next) {
|
export function fetchFollowedHashtagsSuccess(followed_tags, next) {
|
||||||
return {
|
return {
|
||||||
|
@ -68,14 +68,14 @@ export function fetchFollowedHashtagsSuccess(followed_tags, next) {
|
||||||
followed_tags,
|
followed_tags,
|
||||||
next,
|
next,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function fetchFollowedHashtagsFail(error) {
|
export function fetchFollowedHashtagsFail(error) {
|
||||||
return {
|
return {
|
||||||
type: FOLLOWED_HASHTAGS_FETCH_FAIL,
|
type: FOLLOWED_HASHTAGS_FETCH_FAIL,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function expandFollowedHashtags() {
|
export function expandFollowedHashtags() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -94,13 +94,13 @@ export function expandFollowedHashtags() {
|
||||||
dispatch(expandFollowedHashtagsFail(error));
|
dispatch(expandFollowedHashtagsFail(error));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function expandFollowedHashtagsRequest() {
|
export function expandFollowedHashtagsRequest() {
|
||||||
return {
|
return {
|
||||||
type: FOLLOWED_HASHTAGS_EXPAND_REQUEST,
|
type: FOLLOWED_HASHTAGS_EXPAND_REQUEST,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function expandFollowedHashtagsSuccess(followed_tags, next) {
|
export function expandFollowedHashtagsSuccess(followed_tags, next) {
|
||||||
return {
|
return {
|
||||||
|
@ -108,14 +108,14 @@ export function expandFollowedHashtagsSuccess(followed_tags, next) {
|
||||||
followed_tags,
|
followed_tags,
|
||||||
next,
|
next,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export function expandFollowedHashtagsFail(error) {
|
export function expandFollowedHashtagsFail(error) {
|
||||||
return {
|
return {
|
||||||
type: FOLLOWED_HASHTAGS_EXPAND_FAIL,
|
type: FOLLOWED_HASHTAGS_EXPAND_FAIL,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
export const followHashtag = name => (dispatch, getState) => {
|
export const followHashtag = name => (dispatch, getState) => {
|
||||||
dispatch(followHashtagRequest(name));
|
dispatch(followHashtagRequest(name));
|
||||||
|
|
|
@ -296,9 +296,9 @@ class Header extends ImmutablePureComponent {
|
||||||
if ((permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) {
|
if ((permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) {
|
||||||
menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${account.get('id')}` });
|
menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${account.get('id')}` });
|
||||||
}
|
}
|
||||||
if (isRemote && (permissions & PERMISSION_MANAGE_FEDERATION) === PERMISSION_MANAGE_FEDERATION) {
|
if (isRemote && (permissions & PERMISSION_MANAGE_FEDERATION) === PERMISSION_MANAGE_FEDERATION) {
|
||||||
menu.push({ text: intl.formatMessage(messages.admin_domain, { domain: remoteDomain }), href: `/admin/instances/${remoteDomain}` });
|
menu.push({ text: intl.formatMessage(messages.admin_domain, { domain: remoteDomain }), href: `/admin/instances/${remoteDomain}` });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = { __html: account.get('note_emojified') };
|
const content = { __html: account.get('note_emojified') };
|
||||||
|
|
|
@ -38,7 +38,7 @@ class FollowedTags extends ImmutablePureComponent {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.dispatch(fetchFollowedHashtags());
|
this.props.dispatch(fetchFollowedHashtags());
|
||||||
};
|
}
|
||||||
|
|
||||||
handleLoadMore = debounce(() => {
|
handleLoadMore = debounce(() => {
|
||||||
this.props.dispatch(expandFollowedHashtags());
|
this.props.dispatch(expandFollowedHashtags());
|
||||||
|
|
|
@ -39,4 +39,4 @@ export default function followed_tags(state = initialState, action) {
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
Loading…
Reference in a new issue