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:
@@ -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;
|
||||
|
@@ -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)">
|
||||
|
Reference in New Issue
Block a user