@apeframework/eslint
Advanced tools
25
base.js
@@ -1,8 +0,9 @@ | ||
'use strict' | ||
import stylisticPlugin from '@stylistic/eslint-plugin' | ||
import importPlugin from 'eslint-plugin-import' | ||
import globals from 'globals' | ||
import baseRules from './rules/base.js' | ||
import importRules from './rules/import.js' | ||
import stylisticRules from './rules/stylistic.js' | ||
const stylisticPlugin = require('@stylistic/eslint-plugin') | ||
const importPlugin = require('eslint-plugin-import') | ||
const globals = require('globals') | ||
module.exports = { | ||
const baseConfig = { | ||
plugins: { | ||
@@ -13,3 +14,3 @@ '@stylistic': stylisticPlugin, | ||
languageOptions: { | ||
sourceType: 'commonjs', | ||
sourceType: 'module', | ||
ecmaVersion: 'latest', | ||
@@ -24,6 +25,10 @@ globals: globals.node, | ||
rules: { | ||
...require('./rules/base'), | ||
...require('./rules/stylistic'), | ||
...require('./rules/import'), | ||
...baseRules, | ||
...stylisticRules, | ||
...importRules, | ||
}, | ||
} | ||
export { | ||
baseConfig as default, | ||
} |
15
jest.js
@@ -1,7 +0,6 @@ | ||
'use strict' | ||
import jestPlugin from 'eslint-plugin-jest' | ||
import globals from 'globals' | ||
import jestRules from './rules/jest.js' | ||
const jestPlugin = require('eslint-plugin-jest') | ||
const globals = require('globals') | ||
module.exports = { | ||
const jestConfig = { | ||
files: ['*.spec.ts', '**/*.spec.ts', '*.test.ts', '**/*.test.ts'], | ||
@@ -22,4 +21,8 @@ plugins: { | ||
rules: { | ||
...require('./rules/jest'), | ||
...jestRules, | ||
}, | ||
} | ||
export { | ||
jestConfig as default, | ||
} |
{ | ||
"name": "@apeframework/eslint", | ||
"version": "0.0.0-dev.16", | ||
"version": "0.0.0-dev.17", | ||
"license": "MIT", | ||
@@ -19,17 +19,17 @@ "author": "Matthieu Symoens", | ||
}, | ||
"main": "index.js", | ||
"type": "module", | ||
"dependencies": { | ||
"@stylistic/eslint-plugin": "^2.9", | ||
"@stylistic/eslint-plugin": "^2.12", | ||
"eslint-import-resolver-jest": "^3.0", | ||
"eslint-import-resolver-typescript": "^3.6", | ||
"eslint-import-resolver-typescript": "^3.7", | ||
"eslint-plugin-import": "^2.31", | ||
"eslint-plugin-jest": "^28.8", | ||
"eslint-plugin-vue": "^9.30", | ||
"globals": "^15.11", | ||
"typescript-eslint": "^8.8", | ||
"eslint-plugin-jest": "^28.10", | ||
"eslint-plugin-vue": "^9.32", | ||
"globals": "^15.14", | ||
"typescript-eslint": "^8.18", | ||
"vue-eslint-parser": "^9.4" | ||
}, | ||
"peerDependencies": { | ||
"eslint": "^9.12" | ||
"eslint": "^9.17" | ||
} | ||
} |
# Ape Framework ESLint configuration | ||
[ESLint](https://eslint.org) configuration for [Ape Framework](https://github.com/ApeFramework/apeframework). | ||
[Ape Framework](https://github.com/ApeFramework/apeframework) [ESLint](https://eslint.org) configuration. | ||
@@ -20,10 +20,8 @@ NPM package: [@apeframework/eslint](https://www.npmjs.com/package/@apeframework/eslint). | ||
```js | ||
'use strict' | ||
import base from '@apeframework/eslint/base.js' | ||
import jest from '@apeframework/eslint/jest.js' | ||
import typescript from '@apeframework/eslint/typescript.js' | ||
import vue from '@apeframework/eslint/vue.js' | ||
const base = require('@apeframework/eslint/base') | ||
const jest = require('@apeframework/eslint/jest') | ||
const typescript = require('@apeframework/eslint/typescript') | ||
const vue = require('@apeframework/eslint/vue') | ||
module.exports = [ | ||
const config = [ | ||
base, | ||
@@ -34,2 +32,6 @@ jest, | ||
] | ||
export { | ||
config as default, | ||
} | ||
``` |
@@ -1,4 +0,2 @@ | ||
'use strict' | ||
module.exports = { | ||
const baseRules = { | ||
'accessor-pairs': [ | ||
@@ -432,2 +430,5 @@ 'error', | ||
], | ||
'no-useless-assignment': [ | ||
'error', | ||
], | ||
'no-useless-backreference': [ | ||
@@ -566,1 +567,5 @@ 'error', | ||
} | ||
export { | ||
baseRules as default, | ||
} |
@@ -1,4 +0,2 @@ | ||
'use strict' | ||
module.exports = { | ||
const importRules = { | ||
'import/consistent-type-specifier-style': [ | ||
@@ -20,2 +18,7 @@ 'error', | ||
'error', | ||
'never', | ||
{ | ||
js: 'always', | ||
vue: 'always', | ||
}, | ||
], | ||
@@ -126,1 +129,5 @@ 'import/first': [ | ||
} | ||
export { | ||
importRules as default, | ||
} |
@@ -1,4 +0,2 @@ | ||
'use strict' | ||
module.exports = { | ||
const jestRules = { | ||
'jest/consistent-test-it': [ | ||
@@ -168,1 +166,5 @@ 'error', | ||
} | ||
export { | ||
jestRules as default, | ||
} |
@@ -1,4 +0,2 @@ | ||
'use strict' | ||
module.exports = { | ||
const stylisticRules = { | ||
'@stylistic/array-bracket-newline': [ | ||
@@ -63,2 +61,5 @@ 'error', | ||
], | ||
'@stylistic/curly-newline': [ | ||
'error', | ||
], | ||
'@stylistic/dot-location': [ | ||
@@ -364,1 +365,5 @@ 'error', | ||
} | ||
export { | ||
stylisticRules as default, | ||
} |
@@ -1,4 +0,2 @@ | ||
'use strict' | ||
module.exports = { | ||
const typescriptRules = { | ||
'@typescript-eslint/adjacent-overload-signatures': [ | ||
@@ -219,2 +217,5 @@ 'error', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'@typescript-eslint/no-unsafe-type-assertion': [ | ||
'error', | ||
], | ||
'@typescript-eslint/no-unsafe-unary-minus': [ | ||
@@ -302,2 +303,5 @@ 'error', | ||
], | ||
'@typescript-eslint/related-getter-setter-pairs': [ | ||
'error', | ||
], | ||
'@typescript-eslint/require-array-sort-compare': [ | ||
@@ -336,1 +340,5 @@ 'error', | ||
} | ||
export { | ||
typescriptRules as default, | ||
} |
@@ -1,4 +0,2 @@ | ||
'use strict' | ||
module.exports = { | ||
const typescriptDisabledRules = { | ||
'class-methods-use-this': 'off', | ||
@@ -30,1 +28,5 @@ 'consistent-return': 'off', | ||
} | ||
export { | ||
typescriptDisabledRules as default, | ||
} |
@@ -1,4 +0,2 @@ | ||
'use strict' | ||
module.exports = { | ||
const vueRules = { | ||
'vue/attribute-hyphenation': [ | ||
@@ -430,2 +428,5 @@ 'error', | ||
], | ||
'vue/prefer-use-template-ref': [ | ||
'error', | ||
], | ||
'vue/prop-name-casing': [ | ||
@@ -494,2 +495,5 @@ 'error', | ||
], | ||
'vue/restricted-component-names': [ | ||
'error', | ||
], | ||
'vue/return-in-computed-property': [ | ||
@@ -507,2 +511,5 @@ 'error', | ||
], | ||
'vue/slot-name-casing': [ | ||
'error', | ||
], | ||
'vue/sort-keys': [ | ||
@@ -614,1 +621,5 @@ 'error', | ||
} | ||
export { | ||
vueRules as default, | ||
} |
@@ -1,6 +0,6 @@ | ||
'use strict' | ||
import typescriptPlugin from 'typescript-eslint' | ||
import typescriptRules from './rules/typescript.js' | ||
import typescriptDisabledRules from './rules/typescriptDisabled.js' | ||
const typescriptPlugin = require('typescript-eslint') | ||
module.exports = { | ||
const typescriptConfig = { | ||
files: ['*.ts', '**/*.ts'], | ||
@@ -25,5 +25,9 @@ plugins: { | ||
rules: { | ||
...require('./rules/typescriptDisabled'), | ||
...require('./rules/typescript'), | ||
...typescriptDisabledRules, | ||
...typescriptRules, | ||
}, | ||
} | ||
export { | ||
typescriptConfig as default, | ||
} |
23
vue.js
@@ -1,8 +0,9 @@ | ||
'use strict' | ||
import vuePlugin from 'eslint-plugin-vue' | ||
import typescriptPlugin from 'typescript-eslint' | ||
import vueParser from 'vue-eslint-parser' | ||
import typescriptRules from './rules/typescript.js' | ||
import typescriptDisabledRules from './rules/typescriptDisabled.js' | ||
import vueRules from './rules/vue.js' | ||
const vuePlugin = require('eslint-plugin-vue') | ||
const typescriptPlugin = require('typescript-eslint') | ||
const vueParser = require('vue-eslint-parser') | ||
module.exports = { | ||
const vueConfig = { | ||
files: ['*.vue', '**/*.vue'], | ||
@@ -31,6 +32,10 @@ plugins: { | ||
rules: { | ||
...require('./rules/typescriptDisabled'), | ||
...require('./rules/typescript'), | ||
...require('./rules/vue'), | ||
...typescriptDisabledRules, | ||
...typescriptRules, | ||
...vueRules, | ||
}, | ||
} | ||
export { | ||
vueConfig as default, | ||
} |
Sorry, the diff of this file is not supported yet
45720
2.39%2345
2.49%36
5.88%Yes
NaN