1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-26 23:34:45 +00:00

run npm lint when open PR (#6375)

* 01 fix code warnings

* 02 change test.yml
This commit is contained in:
Michael An
2024-07-19 11:14:28 +08:00
committed by GitHub
parent c3b9b96ed9
commit 88dc8d0cac
10 changed files with 72 additions and 30 deletions

View File

@@ -3,7 +3,7 @@ const getValueLength = (str) => {
let len = 0;
for (let i = 0; i < str.length; i++) {
code = str.charCodeAt(i);
if (code == 10) { //solve enter problem
if (code == 10) { // solve enter problem
len += 2;
} else if (code < 0x007f) {
len += 1;

View File

@@ -55,7 +55,7 @@ class Search extends Component {
onChangeHandler = (event) => {
let _this = this;
this.setState({value: event.target.value});
this.setState({ value: event.target.value });
let newValue = event.target.value;
if (this.inputValue === newValue.trim()) {
return false;
@@ -124,7 +124,7 @@ class Search extends Component {
sendRequest(queryData) {
// 'page=1' for this first request
this.setState({page: 1}, () => {
this.setState({ page: 1 }, () => {
const { search_repo, q } = queryData;
const { page, perPage } = this.state;
this.searchWiki(search_repo, q, page, perPage);
@@ -220,7 +220,7 @@ class Search extends Component {
render() {
let width = this.state.width !== 'default' ? this.state.width : '';
let style = {'width': width};
let style = { 'width': width };
return (
<Fragment>
<MediaQuery query="(min-width: 768px)">