mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-23 06:25:14 +00:00
2c7e152644
* lint: fix lint warning that is easy to fix * lint: typesafe signature of seqOrText * lint: typesafe createLanguage and language * lint: typesafe seq * lint: typesafe Parser.option * fix: node can be string * lint: typesafe alt * fix: invalid url in link element will cause error * chore: get rid of any * fix: unnecessary import * lint: kill any but still with loose type checking * Revert "lint: kill any but still with loose type checking" This reverts commit 8c7462f4a745800499a63ecf0632df3647b3e22c. * lint: kill any again * test: write type test * ci: upgrade node version for lint
63 lines
1.8 KiB
JavaScript
63 lines
1.8 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: {
|
|
tsconfigRootDir: __dirname,
|
|
project: ['./tsconfig.json'],
|
|
},
|
|
plugins: [
|
|
'@typescript-eslint',
|
|
],
|
|
extends: [
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
],
|
|
rules: {
|
|
'indent': ['error', 'tab', {
|
|
'SwitchCase': 1,
|
|
'MemberExpression': 'off',
|
|
'flatTernaryExpressions': true,
|
|
'ArrayExpression': 'first',
|
|
'ObjectExpression': 'first',
|
|
}],
|
|
'eol-last': ['error', 'always'],
|
|
'semi': ['error', 'always'],
|
|
'quotes': ['error', 'single'],
|
|
'comma-dangle': ['error', 'always-multiline'],
|
|
'keyword-spacing': ['error', {
|
|
'before': true,
|
|
'after': true,
|
|
}],
|
|
'key-spacing': ['error', {
|
|
'beforeColon': false,
|
|
'afterColon': true,
|
|
}],
|
|
'space-infix-ops': ['error'],
|
|
'space-before-blocks': ['error', 'always'],
|
|
'object-curly-spacing': ['error', 'always'],
|
|
'nonblock-statement-body-position': ['error', 'beside'],
|
|
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
|
|
'no-multiple-empty-lines': ['error', { 'max': 1 }],
|
|
'no-multi-spaces': ['error'],
|
|
'no-var': ['error'],
|
|
'prefer-arrow-callback': ['error'],
|
|
'no-throw-literal': ['error'],
|
|
'no-param-reassign': ['warn'],
|
|
'no-constant-condition': ['warn', {
|
|
checkLoops: false,
|
|
}],
|
|
'no-empty-pattern': ['warn'],
|
|
'@typescript-eslint/no-unnecessary-condition': ['warn', {
|
|
allowConstantLoopConditions: true,
|
|
}],
|
|
'@typescript-eslint/no-inferrable-types': ['warn'],
|
|
'@typescript-eslint/no-non-null-assertion': ['warn'],
|
|
'@typescript-eslint/explicit-function-return-type': ['warn'],
|
|
'@typescript-eslint/no-misused-promises': ['error', {
|
|
'checksVoidReturn': false,
|
|
}],
|
|
'@typescript-eslint/no-unused-vars': ['error', {
|
|
"argsIgnorePattern": "^_",
|
|
}]
|
|
},
|
|
};
|