Skip to content

Commit

Permalink
Add flat recommended config
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerVigario committed Apr 25, 2024
1 parent b2a2945 commit 76f7c8f
Showing 1 changed file with 47 additions and 31 deletions.
78 changes: 47 additions & 31 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,61 @@
const path = require('path');
const importModules = require('import-modules');

const rules = {
'ava/assertion-arguments': 'error',
'ava/hooks-order': 'error',
'ava/max-asserts': [
'off',
5,
],
'ava/no-async-fn-without-await': 'error',
'ava/no-duplicate-modifiers': 'error',
'ava/no-identical-title': 'error',
'ava/no-ignored-test-files': 'error',
'ava/no-import-test-files': 'error',
'ava/no-incorrect-deep-equal': 'error',
'ava/no-inline-assertions': 'error',
'ava/no-nested-tests': 'error',
'ava/no-only-test': 'error',
'ava/no-skip-assert': 'error',
'ava/no-skip-test': 'error',
'ava/no-todo-implementation': 'error',
'ava/no-todo-test': 'warn',
'ava/no-unknown-modifiers': 'error',
'ava/prefer-async-await': 'error',
'ava/prefer-power-assert': 'off',
'ava/prefer-t-regex': 'error',
'ava/test-title': 'error',
'ava/test-title-format': 'off',
'ava/use-t-well': 'error',
'ava/use-t': 'error',
'ava/use-t-throws-async-well': 'error',
'ava/use-test': 'error',
'ava/use-true-false': 'error',
};

module.exports = {
rules: importModules(path.resolve(__dirname, 'rules'), {camelize: false}),
rules: importModules(path.resolve(__dirname, 'rules'), { camelize: false }),
configs: {
recommended: {
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'ava',
],
rules: {
'ava/assertion-arguments': 'error',
'ava/hooks-order': 'error',
'ava/max-asserts': [
'off',
5,
],
'ava/no-async-fn-without-await': 'error',
'ava/no-duplicate-modifiers': 'error',
'ava/no-identical-title': 'error',
'ava/no-ignored-test-files': 'error',
'ava/no-import-test-files': 'error',
'ava/no-incorrect-deep-equal': 'error',
'ava/no-inline-assertions': 'error',
'ava/no-nested-tests': 'error',
'ava/no-only-test': 'error',
'ava/no-skip-assert': 'error',
'ava/no-skip-test': 'error',
'ava/no-todo-implementation': 'error',
'ava/no-todo-test': 'warn',
'ava/no-unknown-modifiers': 'error',
'ava/prefer-async-await': 'error',
'ava/prefer-power-assert': 'off',
'ava/prefer-t-regex': 'error',
'ava/test-title': 'error',
'ava/test-title-format': 'off',
'ava/use-t-well': 'error',
'ava/use-t': 'error',
'ava/use-t-throws-async-well': 'error',
'ava/use-test': 'error',
'ava/use-true-false': 'error',
...rules,
},
},
"flat/recommended": {
rules: {
...rules
}
}
},
};

0 comments on commit 76f7c8f

Please sign in to comment.