Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored rules #10

Merged
merged 11 commits into from
Apr 11, 2023
Merged

Conversation

thomasduenser
Copy link
Member

  • Updated eslint
  • Removed/replaced deprecated rules
  • Changed env values
  • Replaced " with '

@thomasduenser
Copy link
Member Author

thomasduenser commented Mar 30, 2023

@cbl6499 @martinlagler @Quehnie @mscharl @alexander-schranz Please review.

Some rules are deprecated which could be replaced with the node plugin (https://www.npmjs.com/package/eslint-plugin-node). Should this be part of the standard config here?

Additionally a rule to check the JSDoc has been deprecated, which could be replaced with the eslint plugin (https://www.npmjs.com/package/eslint-plugin-jsdoc). Should this be part of the standard config here?

ℹ️ All available rules are available here: https://eslint.org/docs/latest/rules/

@cbl6499
Copy link

cbl6499 commented Mar 30, 2023

Install https://www.npmjs.com/package/eslint-plugin-import and use the plugin
plugins: ['import'],

Additional rules that we use in our projects.

'arrow-parens': ['error', 'always'],
'no-console': 'error',
'import/order': [
    'error',
    {
        alphabetize: {
            order: 'asc',
            caseInsensitive: true,
        },
    },
],
'import/no-dynamic-require': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/export': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-nodejs-modules': 'error',
'import/first': 'error',
'import/no-duplicates': 'error',
'import/no-absolute-path': 'error',
'import/no-unused-modules': 'error',
'import/newline-after-import': ['error', { count: 1 }],

@thomasduenser
Copy link
Member Author

@cbl6499 Done, thank you!

@sabinebaer
Copy link

@thomasduenser All rules are ok for me but max-lines-per-function and complexity could be added (with same values as in PHP).

@sabinebaer
Copy link

@thomasduenser All rules are ok for me but max-lines-per-function and complexity could be added (with same values as in PHP).

As discussed we will not include those two rules for the moment

.circleci/config.yml Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@@ -22,9 +22,10 @@
},
"homepage": "https://github.com/massiveart/eslint-config-ma#readme",
"devDependencies": {
"eslint": "^4.19.1"
"eslint": "^8.37.0",
"eslint-plugin-import": "^2.27.5"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-schranz Thanks, done!

@@ -1,4 +0,0 @@
import $ from 'jquery';

export default $.Deferred();
Copy link
Member

@alexander-schranz alexander-schranz Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this test else eslint fixer does convert $.Deferred to $.deferred which actually targets a not existing jquery method:

#2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-schranz alexander-schranz added the enhancement New feature or request label Apr 11, 2023
@thomasduenser thomasduenser changed the title Updated rules Refactored rules Apr 11, 2023
@thomasduenser thomasduenser merged commit 7d22e54 into massiveart:master Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants