-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: replace tsjs with eslint config (#3496)
- Loading branch information
1 parent
863cbda
commit 345045e
Showing
69 changed files
with
1,190 additions
and
2,236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
extends: [require.resolve('tsjs/eslint-config')], | ||
extends: ['plasma'], | ||
ignorePatterns: ['scripts'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/prettierrc", | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"singleQuote": true, | ||
"bracketSpacing": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'import', 'jsdoc', 'react', 'prefer-arrow', 'react-hooks', 'unused-imports'], | ||
extends: ['plugin:react/jsx-runtime', 'prettier'], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
rules: { | ||
'react-hooks/rules-of-hooks': 'error', | ||
'react-hooks/exhaustive-deps': 'off', | ||
'@typescript-eslint/array-type': [ | ||
'error', | ||
{ | ||
default: 'array-simple', | ||
}, | ||
], | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
types: { | ||
Object: { | ||
message: 'Avoid using the `Object` type. Did you mean `object`?', | ||
}, | ||
Function: { | ||
message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', | ||
}, | ||
// eslint-disable-next-line id-blacklist | ||
Boolean: { | ||
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', | ||
}, | ||
// eslint-disable-next-line id-blacklist | ||
Number: { | ||
message: 'Avoid using the `Number` type. Did you mean `number`?', | ||
}, | ||
// eslint-disable-next-line id-blacklist | ||
String: { | ||
message: 'Avoid using the `String` type. Did you mean `string`?', | ||
}, | ||
Symbol: { | ||
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', | ||
}, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/consistent-type-assertions': 'error', | ||
'@typescript-eslint/dot-notation': 'off', | ||
'@typescript-eslint/explicit-member-accessibility': [ | ||
'error', | ||
{ | ||
accessibility: 'no-public', | ||
}, | ||
], | ||
'@typescript-eslint/indent': 'off', | ||
'@typescript-eslint/member-delimiter-style': [ | ||
'off', | ||
{ | ||
multiline: { | ||
delimiter: 'none', | ||
requireLast: true, | ||
}, | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: false, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/naming-convention': ['warn', {selector: 'enumMember', format: null}], | ||
'@typescript-eslint/no-empty-function': 'error', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/no-misused-new': 'error', | ||
'@typescript-eslint/no-parameter-properties': 'off', | ||
'@typescript-eslint/no-require-imports': 'error', | ||
'@typescript-eslint/no-unused-expressions': 'off', | ||
'@typescript-eslint/no-var-requires': 'error', | ||
'@typescript-eslint/quotes': 'off', | ||
'@typescript-eslint/semi': ['off', null], | ||
'@typescript-eslint/triple-slash-reference': 'error', | ||
'@typescript-eslint/type-annotation-spacing': 'off', | ||
'@typescript-eslint/unified-signatures': 'error', | ||
'arrow-body-style': 'error', | ||
'arrow-parens': ['off', 'always'], | ||
'brace-style': ['off', 'off'], | ||
'comma-dangle': 'off', | ||
'constructor-super': 'error', | ||
curly: 'error', | ||
'default-case': 'error', | ||
'eol-last': 'off', | ||
eqeqeq: ['error', 'smart'], | ||
'guard-for-in': 'error', | ||
'id-blacklist': [ | ||
'error', | ||
'any', | ||
'Number', | ||
'number', | ||
'String', | ||
'string', | ||
'Boolean', | ||
'boolean', | ||
'Undefined', | ||
'undefined', | ||
], | ||
'id-match': 'error', | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: [ | ||
['builtin', 'external', 'internal'], | ||
['parent', 'sibling', 'index', 'object'], | ||
], | ||
}, | ||
], | ||
'jsdoc/check-alignment': 'error', | ||
'jsdoc/check-indentation': 'error', | ||
'linebreak-style': 'off', | ||
'max-len': [ | ||
'off', | ||
{ | ||
code: 140, | ||
}, | ||
], | ||
'new-parens': 'off', | ||
'newline-per-chained-call': 'off', | ||
'no-bitwise': 'error', | ||
'no-caller': 'error', | ||
'no-cond-assign': 'error', | ||
'no-console': [ | ||
'error', | ||
{ | ||
allow: [ | ||
'warn', | ||
'dir', | ||
'timeLog', | ||
'assert', | ||
'clear', | ||
'count', | ||
'countReset', | ||
'group', | ||
'groupEnd', | ||
'table', | ||
'dirxml', | ||
'error', | ||
'groupCollapsed', | ||
'Console', | ||
'profile', | ||
'profileEnd', | ||
'timeStamp', | ||
'context', | ||
], | ||
}, | ||
], | ||
'no-debugger': 'error', | ||
'no-duplicate-case': 'error', | ||
'no-empty': 'error', | ||
'no-eval': 'error', | ||
'no-extra-semi': 'off', | ||
'no-fallthrough': 'off', | ||
'no-irregular-whitespace': 'off', | ||
'no-multiple-empty-lines': 'off', | ||
'no-new-wrappers': 'error', | ||
'no-redeclare': 'error', | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
'no-trailing-spaces': 'off', | ||
'no-undef-init': 'error', | ||
'no-underscore-dangle': 'error', | ||
'no-unsafe-finally': 'error', | ||
'no-unused-labels': 'error', | ||
'no-var': 'error', | ||
'one-var': ['error', 'never'], | ||
'prefer-arrow/prefer-arrow-functions': 'error', | ||
'prefer-const': 'error', | ||
'quote-props': 'off', | ||
radix: 'error', | ||
'react/jsx-curly-spacing': 'off', | ||
'react/jsx-equals-spacing': 'off', | ||
'space-before-function-paren': 'off', | ||
'space-in-parens': ['off', 'never'], | ||
'spaced-comment': [ | ||
'error', | ||
'always', | ||
{ | ||
markers: ['/'], | ||
}, | ||
], | ||
'use-isnan': 'error', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'unused-imports/no-unused-imports': 'error', | ||
'unused-imports/no-unused-vars': [ | ||
'warn', | ||
{vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_'}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "eslint-config-plasma", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "Apache-2.0", | ||
"author": "Coveo", | ||
"main": "index.js", | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "6.2.1", | ||
"@typescript-eslint/parser": "6.2.1", | ||
"eslint": "8.46.0", | ||
"eslint-config-prettier": "8.9.0", | ||
"eslint-plugin-import": "2.28.0", | ||
"eslint-plugin-jsdoc": "46.4.5", | ||
"eslint-plugin-prefer-arrow": "1.2.3", | ||
"eslint-plugin-react": "7.33.1", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"eslint-plugin-unused-imports": "3.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.