Skip to content

Commit a12c525

Browse files
committed
Add package 'eslint-plugin-prefer-arrow'
1 parent 5b3345b commit a12c525

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

.eslintrc.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
extends: ['airbnb', 'prettier'],
3-
plugins: ['@babel', 'react', 'prettier'],
3+
plugins: ['prefer-arrow', '@babel', 'react', 'prettier'],
44
env: {
55
es6: true,
66
browser: true,
@@ -37,6 +37,14 @@ module.exports = {
3737
],
3838
'import/prefer-default-export': 'off',
3939
'import/no-default-export': 'error',
40+
'prefer-arrow/prefer-arrow-functions': [
41+
'warn',
42+
{
43+
disallowPrototype: true,
44+
singleReturnOnly: false,
45+
classPropertiesAllowed: false,
46+
},
47+
],
4048
'no-alert': 0,
4149
'no-console': 0,
4250
'prettier/prettier': 'error',

dist/assets/js/commons.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"eslint-config-prettier": "^8.5.0",
4747
"eslint-plugin-import": "^2.26.0",
4848
"eslint-plugin-jsx-a11y": "^6.5.1",
49+
"eslint-plugin-prefer-arrow": "^1.2.3",
4950
"eslint-plugin-prettier": "^4.0.0",
5051
"eslint-plugin-react": "^7.29.4",
5152
"eslint-webpack-plugin": "^3.1.1",

src/assets/js/_modules/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ export const tests = () => {
119119
return err;
120120
}
121121
};
122-
async function getUser(user) {
122+
const getUser = async user => {
123123
const userData = await doFetch(user);
124124
console.log(userData);
125-
}
125+
};
126126
getUser('sectsect');
127127

128128
// async / await

0 commit comments

Comments
 (0)