Skip to content

Commit

Permalink
Update eslint config (#114)
Browse files Browse the repository at this point in the history
* Update eslint config

* Try to readd dependency

* Update eslint config

* Try to readd dependency

* remove dependency

* Update package-lock

* Regenerate package-lock

* Add to gitignore
  • Loading branch information
yayuyokitano authored Sep 19, 2023
1 parent e197ce7 commit 8653a2f
Show file tree
Hide file tree
Showing 10 changed files with 838 additions and 402 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules/
.DS_Store
18 changes: 1 addition & 17 deletions config/base-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
node: true,
},
extends: ['eslint:recommended'],
plugins: ['jsdoc'],
rules: {
/*
* Possible errors
Expand Down Expand Up @@ -90,7 +89,7 @@ module.exports = {
'no-var': 'error',

// Require method and property shorthand syntax for object literals
'object-shorthand': ['error', 'consistent-as-needed'],
'object-shorthand': ['error', 'always'],

// Require `const` declarations for variables
// that are never reassigned after declared
Expand All @@ -101,20 +100,5 @@ module.exports = {

// Disallow spacing around embedded expressions of template strings
'template-curly-spacing': 'error',

/*
* JSDoc plugin
*/

'jsdoc/check-param-names': 'warn',
'jsdoc/check-syntax': 'warn',
'jsdoc/check-tag-names': 'warn',
'jsdoc/check-types': ['warn', { noDefaults: true }],
'jsdoc/require-param': 'warn',
'jsdoc/require-param-description': 'warn',
'jsdoc/require-param-name': 'warn',
'jsdoc/require-returns-check': 'warn',
'jsdoc/require-returns-description': 'warn',
'jsdoc/valid-types': 'warn',
},
};
15 changes: 15 additions & 0 deletions config/javascript-overrides.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
plugins: ['jsdoc'],
files: ['*.js', '*.jsx'],
parserOptions: {
ecmaFeatures: {
Expand All @@ -10,8 +11,22 @@ module.exports = {
rules: {
strict: ['error', 'global'],

/*
* JSDoc plugin
*/

'jsdoc/check-param-names': 'warn',
'jsdoc/check-syntax': 'warn',
'jsdoc/check-tag-names': 'warn',
'jsdoc/check-types': ['warn', { noDefaults: true }],
'jsdoc/no-undefined-types': 'warn',
'jsdoc/require-param': 'warn',
'jsdoc/require-param-description': 'warn',
'jsdoc/require-param-name': 'warn',
'jsdoc/require-param-type': 'warn',
'jsdoc/require-returns-check': 'warn',
'jsdoc/require-returns-description': 'warn',
'jsdoc/require-returns-type': 'warn',
'jsdoc/valid-types': 'warn',
},
};
18 changes: 18 additions & 0 deletions config/solid-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
files: ['*.tsx'],
plugins: ['solid', 'react'],
extends: ['plugin:solid/recommended', 'plugin:react/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: 'tsconfig.json',
tsconfigRootDir: '.',
},
rules: {
'react/react-in-jsx-scope': 'off',
'react/no-unknown-property': 'off',
'react/jsx-key': 'off',
},
};
6 changes: 4 additions & 2 deletions config/typescript-overrides.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
Expand All @@ -13,15 +14,16 @@ module.exports = {
project: 'tsconfig.json',
tsconfigRootDir: '.',
},
plugins: ['@typescript-eslint'],
rules: {
'prefer-const': ['error', { destructuring: 'all' }],
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowAny: true },
],
'jsdoc/no-types': 'warn',
'tsdoc/syntax': 'warn',
},
};
11 changes: 0 additions & 11 deletions config/vue-overrides.js

This file was deleted.

Loading

0 comments on commit 8653a2f

Please sign in to comment.