silphius/.eslintrc.cjs

89 lines
1.8 KiB
JavaScript
Raw Normal View History

2024-06-10 14:47:05 -05:00
/**
* This is intended to be a basic starting point for linting in your app.
* It relies on recommended configs out of the box for simplicity, but you can
* and should modify this configuration to best suit your team's needs.
*/
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parserOptions: {
2024-06-10 19:35:19 -05:00
ecmaVersion: 'latest',
sourceType: 'module',
2024-06-10 14:47:05 -05:00
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
commonjs: true,
es6: true,
},
2024-06-12 23:17:24 -05:00
globals: {
2024-10-21 08:01:35 -05:00
WeakRef: false,
2024-06-12 23:17:24 -05:00
},
2024-06-23 07:35:56 -05:00
rules: {
'no-constant-condition': ['error', {checkLoops: false}],
},
2024-06-10 14:47:05 -05:00
2024-11-04 12:39:06 -06:00
// Base config
extends: ['eslint:recommended'],
2024-06-16 08:01:01 -05:00
2024-11-04 12:39:06 -06:00
overrides: [
2024-06-10 14:47:05 -05:00
// React
{
2024-11-04 12:39:06 -06:00
files: ['**/*.{js,jsx}'],
2024-06-10 19:35:19 -05:00
plugins: ['react', 'jsx-a11y'],
2024-06-10 14:47:05 -05:00
extends: [
2024-06-10 19:35:19 -05:00
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
2024-06-10 14:47:05 -05:00
],
settings: {
react: {
2024-06-10 19:35:19 -05:00
version: 'detect',
2024-06-10 14:47:05 -05:00
},
2024-06-10 19:35:19 -05:00
formComponents: ['Form'],
2024-06-10 14:47:05 -05:00
linkComponents: [
2024-11-04 12:39:06 -06:00
{name: 'Link', linkAttribute: 'to'},
{name: 'NavLink', linkAttribute: 'to'},
2024-06-10 14:47:05 -05:00
],
},
rules: {
2024-09-18 17:46:42 -05:00
'jsx-a11y/label-has-associated-control': [2, {
controlComponents: ['SliderText'],
}],
2024-10-17 23:35:34 -05:00
'react/prop-types': 'off',
2024-06-10 14:47:05 -05:00
},
},
// Node
{
2024-06-12 23:17:24 -05:00
files: [
'.eslintrc.cjs',
'server.js',
2024-11-04 16:27:31 -06:00
'app/websocket/**',
2024-11-04 12:39:06 -06:00
'**/.server/**',
'*.server.{js,jsx}',
'**/{build,node}.js',
2024-06-12 23:17:24 -05:00
'vite.config.js',
2024-11-04 12:39:06 -06:00
'vitest.workspace.js',
2024-06-12 23:17:24 -05:00
],
2024-06-10 14:47:05 -05:00
env: {
node: true,
},
},
2024-06-21 04:55:07 -05:00
2024-11-04 12:39:06 -06:00
// game scripts
{
files: [
'resources/**/*.js',
],
rules: {
'require-yield': 0,
},
},
2024-06-10 14:47:05 -05:00
],
};