Skip to content

Commit

Permalink
Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
alansemenov committed Sep 4, 2024
1 parent b306c39 commit 4b5482b
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 65 deletions.
18 changes: 16 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
module.exports = {
extends: ['airbnb-base', 'prettier'],
plugins: ['prettier'],
extends: [
'airbnb-base',
'prettier',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
plugins: ['prettier', 'import'],
rules: {
'spaced-comment': ['error', 'always', { exceptions: ['-', '+'] }],
'no-restricted-syntax': ['off'],
Expand All @@ -26,4 +32,12 @@ module.exports = {
node: true,
jest: true,
},
settings: {
'import/resolver': {
typescript: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
},
},
},
// ...
};
174 changes: 137 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"eslint": "^8.45.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.30.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-config/browser.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const globals = require("globals");
const globals = require('globals');

module.exports = {
languageOptions: {
globals: {
...globals.browser
}
}
}
...globals.browser,
},
},
};
5 changes: 1 addition & 4 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const vanillaConfig = require('./vanilla');
const tsConfig = require('./typescript');

module.exports = [
...vanillaConfig,
...tsConfig
]
module.exports = [...vanillaConfig, ...tsConfig];
4 changes: 2 additions & 2 deletions packages/eslint-config/typescript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { plugin: tsPlugin, configs: tsConfigs } = require('typescript-eslint');
const tsParser = require('@typescript-eslint/parser');
const vanillaConfig = require("./vanilla");
const { plugin: tsPlugin, configs: tsConfigs } = require("typescript-eslint");
const vanillaConfig = require('./vanilla');

module.exports = [
...vanillaConfig,
Expand Down
24 changes: 12 additions & 12 deletions packages/eslint-config/vanilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ module.exports = [
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node
}
...globals.node,
},
},
rules: {
quotes: ['error', 'single', {avoidEscape: true}],
quotes: ['error', 'single', { avoidEscape: true }],
'block-spacing': ['error', 'always'],
'space-before-function-paren': [
'error',
{anonymous: 'always', named: 'never'},
{ anonymous: 'always', named: 'never' },
],
'space-in-parens': ['error', 'never'],
'object-curly-spacing': ['error', 'never'],
'lines-between-class-members': [
'error',
'always',
{exceptAfterSingleLine: true},
{ exceptAfterSingleLine: true },
],
'spaced-comment': ['error', 'always', {exceptions: ['-', '+']}],
'arrow-spacing': ['error', {before: true, after: true}],
'spaced-comment': ['error', 'always', { exceptions: ['-', '+'] }],
'arrow-spacing': ['error', { before: true, after: true }],
'array-bracket-spacing': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'template-curly-spacing': ['error', 'never'],
'object-property-newline': [
'off',
{allowMultiplePropertiesPerLine: true},
{ allowMultiplePropertiesPerLine: true },
],
'no-plusplus': ['error', {allowForLoopAfterthoughts: true}],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'comma-dangle': ['error', 'always-multiline'],
}
}
]
},
},
];
4 changes: 2 additions & 2 deletions packages/eslint-config/xp.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ module.exports = {
testInstance: 'readonly',
exports: 'writable',
},
}
}
},
};

0 comments on commit 4b5482b

Please sign in to comment.