* Plug new beta of eslint plugin simple import sort * Apply new configuration to existing imports
45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
// Copyright 2017-2020 @polkadot/apps authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
const base = require('@polkadot/dev/config/eslint.cjs');
|
|
|
|
// add override for any (a metric ton of them, initial conversion)
|
|
module.exports = {
|
|
...base,
|
|
plugins: [...base.plugins, 'simple-import-sort'],
|
|
ignorePatterns: [
|
|
'.eslintrc.js',
|
|
'.github/**',
|
|
'.vscode/**',
|
|
'.yarn/**',
|
|
'**/build/*',
|
|
'**/coverage/*',
|
|
'**/node_modules/*'
|
|
],
|
|
parserOptions: {
|
|
...base.parserOptions,
|
|
project: [
|
|
'./tsconfig.json'
|
|
]
|
|
},
|
|
rules: {
|
|
...base.rules,
|
|
// needs to be switched on at some point
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
// this seems very broken atm, false positives
|
|
'@typescript-eslint/unbound-method': 'off',
|
|
'simple-import-sort/imports': [
|
|
'error',
|
|
{
|
|
groups: [
|
|
['^\u0000'],
|
|
['^[^/\\.].*\u0000$', '^@polkadot.*\u0000$', '^\\..*\u0000$'],
|
|
['^[^/\\.]'],
|
|
['^@polkadot'],
|
|
['^\\.']
|
|
],
|
|
},
|
|
]
|
|
}
|
|
};
|