0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,8 @@
/**
* Default settings for Electron applications.
*/
module.exports = {
settings: {
'import/core-modules': ['electron'],
},
};

14
web/node_modules/eslint-plugin-import/config/errors.js generated vendored Normal file
View file

@ -0,0 +1,14 @@
/**
* unopinionated config. just the things that are necessarily runtime errors
* waiting to happen.
* @type {Object}
*/
module.exports = {
plugins: ['import'],
rules: { 'import/no-unresolved': 2,
'import/named': 2,
'import/namespace': 2,
'import/default': 2,
'import/export': 2,
},
};

View file

@ -0,0 +1,13 @@
/**
* - adds platform extensions to Node resolver
*/
module.exports = {
settings: {
'import/resolver': {
node: {
// Note: will not complain if only _one_ of these files exists.
extensions: ['.js', '.web.js', '.ios.js', '.android.js'],
},
},
},
};

18
web/node_modules/eslint-plugin-import/config/react.js generated vendored Normal file
View file

@ -0,0 +1,18 @@
/**
* Adds `.jsx` as an extension, and enables JSX parsing.
*
* Even if _you_ aren't using JSX (or .jsx) directly, if your dependencies
* define jsnext:main and have JSX internally, you may run into problems
* if you don't enable these settings at the top level.
*/
module.exports = {
settings: {
'import/extensions': ['.js', '.jsx'],
},
parserOptions: {
ecmaFeatures: { jsx: true },
},
};

View file

@ -0,0 +1,28 @@
/**
* The basics.
* @type {Object}
*/
module.exports = {
plugins: ['import'],
rules: {
// analysis/correctness
'import/no-unresolved': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
// red flags (thus, warnings)
'import/no-named-as-default': 'warn',
'import/no-named-as-default-member': 'warn',
'import/no-duplicates': 'warn',
},
// need all these for parsing dependencies (even if _your_ code doesn't need
// all of them)
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
},
};

View file

@ -0,0 +1,12 @@
/**
* Rules in progress.
*
* Do not expect these to adhere to semver across releases.
* @type {Object}
*/
module.exports = {
plugins: ['import'],
rules: {
'import/no-deprecated': 1,
},
};

View file

@ -0,0 +1,28 @@
/**
* Adds `.jsx`, `.ts` and `.tsx` as an extension, and enables JSX/TSX parsing.
*/
const allExtensions = ['.ts', '.tsx', '.d.ts', '.js', '.jsx'];
module.exports = {
settings: {
'import/extensions': allExtensions,
'import/external-module-folders': ['node_modules', 'node_modules/@types'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
},
'import/resolver': {
'node': {
'extensions': allExtensions,
},
},
},
rules: {
// analysis/correctness
// TypeScript compilation already ensures that named imports exist in the referenced module
'import/named': 'off',
},
};

View file

@ -0,0 +1,12 @@
/**
* more opinionated config.
* @type {Object}
*/
module.exports = {
plugins: ['import'],
rules: {
'import/no-named-as-default': 1,
'import/no-named-as-default-member': 1,
'import/no-duplicates': 1,
},
};