mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 10:11:32 +03:00
5906b5ca5d
* refactor(tauri.js): Fix ESLint errors * fix(tauri.js): Disable space-before-function-paren This conflicts with @typescript-eslint/space-before-function-paren. See https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md#how-to-use * refactor(tauri.js): Change requires to imports * fix(tauri.js): Suppress security/detect-non-literal-fs-filename in src/api/info.ts * fix(tauri.js): Suppress @typescript-eslint/restrict-template-expressions in some cases * fix(tauri.js): Suppress ESLint warnings in src/template/index.ts - Suppress security/detect-object-injection (false positives) - Suppress @typescript-eslint/no-dynamic-delete
62 lines
1.7 KiB
JavaScript
62 lines
1.7 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
|
|
env: {
|
|
node: true,
|
|
jest: true
|
|
},
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
extends: [
|
|
'standard-with-typescript',
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
'plugin:lodash-template/recommended'
|
|
// TODO: make this work with typescript
|
|
// 'plugin:node/recommended'
|
|
],
|
|
|
|
plugins: ['@typescript-eslint', 'node', 'security'],
|
|
|
|
parserOptions: {
|
|
tsconfigRootDir: __dirname,
|
|
project: './tsconfig.json'
|
|
},
|
|
|
|
globals: {
|
|
__statics: true,
|
|
process: true
|
|
},
|
|
|
|
// add your custom rules here
|
|
rules: {
|
|
// allow console.log during development only
|
|
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
// allow debugger during development only
|
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
'no-process-exit': 'off',
|
|
'security/detect-non-literal-fs-filename': 'warn',
|
|
'security/detect-unsafe-regex': 'error',
|
|
'security/detect-buffer-noassert': 'error',
|
|
'security/detect-child-process': 'warn',
|
|
'security/detect-disable-mustache-escape': 'error',
|
|
'security/detect-eval-with-expression': 'error',
|
|
'security/detect-no-csrf-before-method-override': 'error',
|
|
'security/detect-non-literal-regexp': 'error',
|
|
'security/detect-non-literal-require': 'warn',
|
|
'security/detect-object-injection': 'warn',
|
|
'security/detect-possible-timing-attacks': 'error',
|
|
'security/detect-pseudoRandomBytes': 'error',
|
|
'space-before-function-paren': 'off',
|
|
'@typescript-eslint/strict-boolean-expressions': 0,
|
|
'@typescript-eslint/space-before-function-paren': [
|
|
'error',
|
|
{
|
|
asyncArrow: 'always',
|
|
anonymous: 'never',
|
|
named: 'never'
|
|
}
|
|
]
|
|
}
|
|
}
|