├── .gitignore ├── index.js ├── .editorconfig ├── test ├── canary.js └── utils.js ├── lib ├── utils.js └── index.js ├── package.json ├── CHANGELOG.md ├── README.md └── eslint.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | .vscode 3 | node_modules 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import config from './eslint.config.js'; 2 | 3 | export default config; 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true -------------------------------------------------------------------------------- /test/canary.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | 3 | describe('eslint-config-apostrophe:canary', function () { 4 | it('should pass a canary test', function () { 5 | // eslint-disable-next-line 6 | assert.equal(true, true); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | const findMissing = (theirs, ours) => 2 | Object.keys(theirs).filter(rule => !Object.keys(ours).includes(rule)); 3 | 4 | const diff = (theirs, ours) => { 5 | const variants = new Map(); 6 | 7 | const rules = Object.keys(ours); 8 | rules.forEach(rule => { 9 | if (JSON.stringify(ours[rule]) === JSON.stringify(theirs[rule])) { 10 | return; 11 | } 12 | 13 | variants.set(rule, { 14 | standard: theirs[rule], 15 | modified: ours[rule] 16 | }); 17 | }); 18 | 19 | return variants; 20 | }; 21 | 22 | module.exports = { 23 | findMissing, 24 | diff 25 | }; 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-config-apostrophe", 3 | "version": "6.0.2", 4 | "description": "eslint configuration for apostrophe and related core modules", 5 | "main": "index.js", 6 | "engines": { 7 | "node": ">=16" 8 | }, 9 | "type": "module", 10 | "scripts": { 11 | "compare": "node ./lib/index", 12 | "eslint": "eslint . -c eslintrc.json", 13 | "test": "npx mocha" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/apostrophecms/eslint-config-apostrophe.git" 18 | }, 19 | "author": "Apostrophe Technologies, Inc.", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/apostrophecms/eslint-config-apostrophe/issues" 23 | }, 24 | "homepage": "https://github.com/apostrophecms/eslint-config-apostrophe#readme", 25 | "dependencies": { 26 | "eslint": "^9.34.0", 27 | "eslint-plugin-vue": "^10.4.0", 28 | "globals": "^16.3.0", 29 | "neostandard": "^0.12.2" 30 | }, 31 | "devDependencies": { 32 | "mocha": "^10.2.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | const standard = require('eslint-config-standard'); 4 | const config = require('../eslintrc.json'); 5 | 6 | const { findMissing, diff } = require('./utils'); 7 | 8 | const standardRules = standard.rules; 9 | const ourRules = config.rules; 10 | 11 | const missingTemplate = rules => `Missing Rules: 12 | \n 13 | ${rules.join(', ')} 14 | \n 15 | `; 16 | 17 | const diffTemplate = (key, { standard, modified }) => ` 18 | Rule: ${key} 19 | Standard: ${JSON.stringify(standard)} 20 | Ours: ${JSON.stringify(modified)} 21 | `; 22 | 23 | const report = () => { 24 | console.log(`Comparing: 25 | eslint-config-standard to eslint-config-apostrophe 26 | \n`); 27 | 28 | const missing = findMissing(standardRules, ourRules); 29 | 30 | if (missing.length) { 31 | console.log(missingTemplate(missing)); 32 | } 33 | 34 | console.log('Modified Rules:\n'); 35 | 36 | const variants = diff(standardRules, ourRules); 37 | 38 | for (const [ key, value ] of variants) { 39 | console.log(diffTemplate(key, value)); 40 | } 41 | }; 42 | 43 | module.exports = report(); 44 | -------------------------------------------------------------------------------- /test/utils.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const utils = require('../lib/utils'); 3 | 4 | describe('eslint-config-apostrophe:utils', function () { 5 | it('should find missing rules', function () { 6 | const a = [ 1, 2, 3 ]; 7 | const b = [ 3 ]; 8 | 9 | const expected = [ 1, 2 ]; 10 | const actual = utils.findMissing(a, b); 11 | 12 | assert.deepEqual(expected, actual); 13 | assert.notDeepEqual([ 1 ], actual); 14 | }); 15 | 16 | it('should find differences in simple rules', function () { 17 | const a = { 18 | foo: 'bar', 19 | bar: 'baz' 20 | }; 21 | 22 | const b = { 23 | foo: 'baz', 24 | bar: 'baz' 25 | }; 26 | 27 | const expected = new Map(); 28 | expected.set('foo', { 29 | standard: 'bar', 30 | modified: 'baz' 31 | }); 32 | 33 | const actual = utils.diff(a, b); 34 | assert.deepEqual(expected, actual); 35 | 36 | expected.set('foo', { 37 | standard: 'bar', 38 | modified: 'bar' 39 | }); 40 | assert.notDeepEqual(expected, actual); 41 | }); 42 | 43 | it('should find differences in complex rules', function () { 44 | const a = { 45 | 'brace-style': [ 'error', '1tbs', { allowSingleLine: true } ], 46 | curly: [ 'error', 'multi-line' ] 47 | }; 48 | const b = { 49 | 'brace-style': [ 'warn', '1tbs' ], 50 | curly: [ 'warn', 'all' ] 51 | }; 52 | 53 | const expected = new Map(); 54 | expected.set('brace-style', { 55 | standard: [ 'error', '1tbs', { allowSingleLine: true } ], 56 | modified: [ 'warn', '1tbs' ] 57 | }); 58 | 59 | expected.set('curly', { 60 | standard: [ 'error', 'multi-line' ], 61 | modified: [ 'warn', 'all' ] 62 | }); 63 | 64 | const actual = utils.diff(a, b); 65 | assert.deepEqual(expected, actual); 66 | }); 67 | }); 68 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 6.0.2 (2025-09-16) 2 | 3 | ### Fixes 4 | 5 | - Ignore `apos-build`, `data` and `public` directories recursively. 6 | 7 | ## 6.0.1 (2025-09-09) 8 | 9 | ### Fixes 10 | 11 | - Apply `vue/max-len` rule to vue files only. 12 | 13 | ## 6.0.0 (2025-09-09) 14 | 15 | ### Breaking changes 16 | 17 | - Migration to `eslint@9` and `neostandard`. 18 | 19 | ## 5.0.0 (2024-03-31) 20 | 21 | ### Adds 22 | 23 | - Adds `eslint-plugin-vue` to the dependencies. 24 | 25 | ### Changes 26 | 27 | - No console in tests. 28 | - Same config for frontend js and vue. 29 | 30 | ## 4.3.0 (2024-02-14) 31 | 32 | ### Adds 33 | 34 | - Global macros for vue 3. 35 | 36 | ### Changes 37 | 38 | - Makes max-len a warning, updates its options. 39 | 40 | ## 4.2.1 (2024-01-10) 41 | 42 | ### Fixes 43 | 44 | - Removed logic to automatically detect out of date eslint plugins. 45 | Unfortunately this is [not safe in current Node.js if any of those 46 | plugins use the `exports` feature in `package.json`](https://github.com/nodejs/node/issues/33460), 47 | which led to install failures for a related module. 48 | 49 | ## 4.2.0 (2023-11-29) 50 | 51 | ### Adds 52 | 53 | - Adds max-len rule 54 | 55 | ## 4.1.0 - 2023-08-03 56 | 57 | ### Adds 58 | 59 | - Use latest eslint-config-standard 60 | 61 | ## 4.0.0 - 2023-06-21 62 | 63 | ### Changes 64 | 65 | - Upgraded dependencies 66 | - Swapped eslint-plugin-node for eslint-plugin-n which is what standard now uses 67 | 68 | ### Adds 69 | 70 | - Added missing rules no-var, object-shorthand, array-callback-return, default-case-last, multiline-ternary, no-useless-backreference, no-empty, no-import-assign, no-loss-of-precision, no-unreachable-loop, prefer-regex-literals, n/handle-callback-err, n/no-callback-literal, n/no-deprecated-api, n/no-exports-assign, n/no-new-require, n/no-path-concat, n/process-exit-as-throw 71 | 72 | ### Fixes 73 | 74 | - Fixed `compare` check which was returning some false positives 75 | 76 | ## 3.4.2 2022-04-20 77 | 78 | Use semver range to pin to a major version of eslint-config-standard that supports eslint 7. 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | An ESLint configuration for ApostropheCMS core and officials modules. 2 | 3 | Add the following to your `.eslintrc` file to use in your project: 4 | 5 | ```javascript 6 | { 7 | "extends": "apostrophe" 8 | } 9 | ``` 10 | 11 | ## Contributing 12 | 13 | To contribute to this config or run tests, clone the repository and run `npm install`. You can then run `npm test` to run the basic tests. 14 | 15 | ## Viewing differences between the standard configuration and ours 16 | 17 | From this project's root, run 18 | 19 | ``` 20 | npm run compare 21 | ``` 22 | 23 | This will print a report in your terminal which shows which rules we not added to our config and which rules we have specifically modified. 24 | 25 | All missing rules should be added to the `.eslintrc.json` with a definition even if we agree with the standard. This ensures that we are aware of any new rules or changed defintions that are made to the standard and will allow us to lock down the rule definitions that we agree with. 26 | 27 | ## Changelog 28 | 29 | New major versions will be used whenever a new rule is added that returns an `error` on failure. This is to avoid breaking projects using this configuration as they do normal package updates. If a new rule is added that is simply set to `warn`, minor versions may be used since this should not break build, but only create warning messages for you to resolve or override with rules in your project configuration. 30 | 31 | - 3.4.1 (2020-10-21): Updates `eslint-plugin-import`. 32 | - 3.4.0 (2020-08-26): Adds a script to check what rules from `eslint-config-standard` that we are not yet setting in this config. The goal of this is to make sure that any new rules we work with are intentional, rather than unexpectedly inherited from `eslint-config-standard`. Also copies over missing eslint rules with the configurations from `eslint-config-standard`. There should be no functional changes in linting. 33 | - 3.3.0: Adds a warning enforcing a single space inside of array brackets. 34 | - 3.2.0: Adds a warning for the `quotes` rule to enforce single quotes. This should change to an error in the next major version. 35 | - 3.1.0: Adds a warning for the `curly` and `brace-style` rules to avoid single line blocks. Also `object-curly-newline` and `object-property-newline` rules to have similar treatment for objects. Adds the changelog versioning guidelines. 36 | - 3.0.0: Adds a warning for the `no-var` rule. 37 | - 2.0.2: packaging issue, no changes. 38 | - 2.0.1: use `import/no-extraneous-dependencies` to detect `require` calls that are not backed by a real dependency of this project or module. 39 | - 2.0.0: initial release. 40 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | import globals from 'globals'; 2 | import pluginVue from 'eslint-plugin-vue'; 3 | import neostandard from 'neostandard'; 4 | import { defineConfig, globalIgnores } from 'eslint/config'; 5 | 6 | export default defineConfig([ 7 | globalIgnores([ 8 | '**/node_modules', 9 | '**/ui/public/**/*.js', 10 | '**/apos-build', 11 | '**/data', 12 | '**/public' 13 | ]), 14 | ...neostandard(), 15 | ...pluginVue.configs['flat/recommended'], 16 | { 17 | languageOptions: { 18 | parserOptions: { 19 | ecmaVersion: 'latest', 20 | sourceType: 'module' 21 | } 22 | } 23 | }, 24 | { 25 | rules: { 26 | 'no-var': 'error', 27 | 'object-shorthand': [ 'warn', 'properties' ], 28 | 'accessor-pairs': [ 'error', { 29 | setWithoutGet: true, 30 | enforceForClassMembers: true 31 | } ], 32 | 'array-callback-return': [ 'error', { 33 | allowImplicit: false, 34 | checkForEach: false 35 | } ], 36 | camelcase: [ 'error', { properties: 'never' } ], 37 | 'constructor-super': 'error', 38 | curly: [ 'warn', 'all' ], 39 | 'default-case-last': 'error', 40 | 'dot-notation': [ 'error', { allowKeywords: true } ], 41 | eqeqeq: [ 'error', 'always', { null: 'ignore' } ], 42 | 'func-call-spacing': [ 'error', 'never' ], 43 | 'new-cap': [ 'error', { 44 | newIsCap: true, 45 | capIsNew: false, 46 | properties: true 47 | } ], 48 | 'no-array-constructor': 'error', 49 | 'no-async-promise-executor': 'error', 50 | 'no-caller': 'error', 51 | 'no-case-declarations': 'error', 52 | 'no-class-assign': 'error', 53 | 'no-compare-neg-zero': 'error', 54 | 'no-cond-assign': 'error', 55 | 'no-const-assign': 'error', 56 | 'no-constant-condition': [ 'error', { checkLoops: false } ], 57 | 'no-control-regex': 'error', 58 | 'no-debugger': 'error', 59 | 'no-delete-var': 'error', 60 | 'no-dupe-args': 'error', 61 | 'no-dupe-class-members': 'error', 62 | 'no-dupe-keys': 'error', 63 | 'no-duplicate-case': 'error', 64 | 'no-useless-backreference': 'error', 65 | 'no-empty': [ 'error', { allowEmptyCatch: true } ], 66 | 'no-empty-character-class': 'error', 67 | 'no-empty-pattern': 'error', 68 | 'no-eval': 'error', 69 | 'no-ex-assign': 'error', 70 | 'no-extend-native': 'error', 71 | 'no-extra-bind': 'error', 72 | 'no-extra-boolean-cast': 'error', 73 | 'no-fallthrough': 'error', 74 | 'no-func-assign': 'error', 75 | 'no-global-assign': 'error', 76 | 'no-implied-eval': 'error', 77 | 'no-import-assign': 'error', 78 | 'no-invalid-regexp': 'error', 79 | 'no-irregular-whitespace': 'error', 80 | 'no-iterator': 'error', 81 | 'no-labels': [ 'error', { 82 | allowLoop: false, 83 | allowSwitch: false 84 | } ], 85 | 'no-lone-blocks': 'error', 86 | 'no-loss-of-precision': 'error', 87 | 'no-misleading-character-class': 'error', 88 | 'no-prototype-builtins': 'error', 89 | 'no-useless-catch': 'error', 90 | 'no-mixed-operators': [ 'error', { 91 | groups: [ [ '==', '!=', '===', '!==', '>', '>=', '<', '<=' ], [ '&&', '||' ], [ 'in', 'instanceof' ] ], 92 | allowSamePrecedence: true 93 | } ], 94 | 'no-multi-str': 'error', 95 | 'no-new': 'error', 96 | 'no-new-func': 'error', 97 | 'no-new-object': 'error', 98 | 'no-new-symbol': 'error', 99 | 'no-new-wrappers': 'error', 100 | 'no-obj-calls': 'error', 101 | 'no-octal': 'error', 102 | 'no-octal-escape': 'error', 103 | 'no-proto': 'error', 104 | 'no-redeclare': [ 'error', { builtinGlobals: false } ], 105 | 'no-regex-spaces': 'error', 106 | 'no-return-assign': [ 'error', 'except-parens' ], 107 | 'no-self-assign': [ 'error', { props: true } ], 108 | 'no-self-compare': 'error', 109 | 'no-sequences': 'error', 110 | 'no-shadow-restricted-names': 'error', 111 | 'no-sparse-arrays': 'error', 112 | 'no-template-curly-in-string': 'error', 113 | 'no-this-before-super': 'error', 114 | 'no-throw-literal': 'off', 115 | 'no-undef': 'error', 116 | 'no-undef-init': 'error', 117 | 'no-unexpected-multiline': 'error', 118 | 'no-unmodified-loop-condition': 'error', 119 | 'no-unneeded-ternary': [ 'error', { defaultAssignment: false } ], 120 | 'no-unreachable': 'error', 121 | 'no-unreachable-loop': 'error', 122 | 'no-unsafe-finally': 'error', 123 | 'no-unsafe-negation': 'error', 124 | 'no-unused-expressions': [ 'error', { 125 | allowShortCircuit: true, 126 | allowTernary: true, 127 | allowTaggedTemplates: true 128 | } ], 129 | 'no-unused-vars': [ 'error', { 130 | varsIgnorePattern: '^_[^_].*$|^_$', 131 | args: 'none', 132 | ignoreRestSiblings: true, 133 | caughtErrors: 'none' 134 | } ], 135 | 'no-use-before-define': [ 'error', { 136 | functions: false, 137 | classes: false, 138 | variables: false 139 | } ], 140 | 'no-useless-call': 'error', 141 | 'no-useless-computed-key': 'error', 142 | 'no-useless-constructor': 'error', 143 | 'no-useless-escape': 'error', 144 | 'no-useless-rename': 'error', 145 | 'no-useless-return': 'error', 146 | 'no-void': 'error', 147 | 'no-with': 'error', 148 | 'object-property-newline': [ 'warn', { allowAllPropertiesOnSameLine: false } ], 149 | 'one-var': [ 'error', { initialized: 'never' } ], 150 | 'prefer-const': [ 'error', { destructuring: 'all' } ], 151 | 'prefer-promise-reject-errors': 'error', 152 | 'prefer-regex-literals': [ 'error', { disallowRedundantWrapping: true } ], 153 | 'symbol-description': 'error', 154 | 'unicode-bom': [ 'error', 'never' ], 155 | 'use-isnan': 'error', 156 | 'valid-typeof': [ 'error', { requireStringLiterals: true } ], 157 | yoda: [ 'error', 'never' ], 158 | 159 | 'import-x/export': 'error', 160 | 'import-x/first': 'error', 161 | 'import-x/no-absolute-path': [ 'error', { 162 | esmodule: true, 163 | commonjs: true, 164 | amd: false 165 | } ], 166 | 'import-x/no-duplicates': 'error', 167 | 'import-x/no-named-default': 'error', 168 | 'import-x/no-webpack-loader-syntax': 'error', 169 | 170 | 'n/handle-callback-err': [ 'error', '^(err|error)$' ], 171 | 'n/no-callback-literal': 'off', 172 | 'n/no-deprecated-api': 'error', 173 | 'n/no-exports-assign': 'error', 174 | 'n/no-new-require': 'error', 175 | 'n/no-path-concat': 'off', 176 | 'n/process-exit-as-throw': 'error', 177 | 178 | 'promise/param-names': 'error', 179 | 180 | '@stylistic/array-bracket-spacing': [ 'warn', 'always' ], 181 | '@stylistic/arrow-spacing': [ 'error', { 182 | before: true, 183 | after: true 184 | } ], 185 | '@stylistic/block-spacing': [ 'error', 'always' ], 186 | '@stylistic/brace-style': [ 'warn', '1tbs' ], 187 | '@stylistic/comma-dangle': [ 'error', { 188 | arrays: 'never', 189 | objects: 'never', 190 | imports: 'never', 191 | exports: 'never', 192 | functions: 'never' 193 | } ], 194 | '@stylistic/comma-spacing': [ 'error', { 195 | before: false, 196 | after: true 197 | } ], 198 | '@stylistic/comma-style': [ 'error', 'last' ], 199 | '@stylistic/computed-property-spacing': [ 'error', 'never' ], 200 | '@stylistic/dot-location': [ 'error', 'property' ], 201 | '@stylistic/eol-last': 'error', 202 | '@stylistic/generator-star-spacing': [ 'error', { 203 | before: true, 204 | after: true 205 | } ], 206 | '@stylistic/indent': [ 207 | 'error', 208 | 2, 209 | { 210 | SwitchCase: 1, 211 | VariableDeclarator: 1, 212 | outerIIFEBody: 1, 213 | MemberExpression: 1, 214 | FunctionDeclaration: { 215 | parameters: 1, 216 | body: 1 217 | }, 218 | FunctionExpression: { 219 | parameters: 1, 220 | body: 1 221 | }, 222 | CallExpression: { arguments: 1 }, 223 | ArrayExpression: 1, 224 | ObjectExpression: 1, 225 | ImportDeclaration: 1, 226 | flatTernaryExpressions: false, 227 | ignoreComments: false, 228 | ignoredNodes: [ 'TemplateLiteral *' ] 229 | } 230 | ], 231 | '@stylistic/key-spacing': [ 'error', { 232 | beforeColon: false, 233 | afterColon: true 234 | } ], 235 | '@stylistic/keyword-spacing': [ 'error', { 236 | before: true, 237 | after: true 238 | } ], 239 | '@stylistic/lines-between-class-members': [ 'error', 'always', { exceptAfterSingleLine: true } ], 240 | '@stylistic/multiline-ternary': [ 'error', 'always-multiline' ], 241 | '@stylistic/new-parens': 'error', 242 | '@stylistic/no-extra-parens': [ 'error', 'functions' ], 243 | '@stylistic/no-floating-decimal': 'error', 244 | '@stylistic/no-mixed-spaces-and-tabs': 'error', 245 | '@stylistic/no-multi-spaces': 'error', 246 | '@stylistic/no-multiple-empty-lines': [ 'error', { 247 | max: 1, 248 | maxEOF: 0 249 | } ], 250 | '@stylistic/no-tabs': 'error', 251 | '@stylistic/no-trailing-spaces': 'error', 252 | '@stylistic/no-whitespace-before-property': 'error', 253 | '@stylistic/object-curly-newline': [ 'warn', { 254 | ObjectExpression: { 255 | minProperties: 2, 256 | consistent: true, 257 | multiline: true 258 | }, 259 | ObjectPattern: { 260 | minProperties: 3, 261 | consistent: true, 262 | multiline: true 263 | }, 264 | ImportDeclaration: { 265 | minProperties: 3, 266 | consistent: true, 267 | multiline: true 268 | }, 269 | ExportDeclaration: { 270 | minProperties: 3, 271 | consistent: true, 272 | multiline: true 273 | } 274 | } ], 275 | '@stylistic/object-curly-spacing': [ 'error', 'always' ], 276 | '@stylistic/operator-linebreak': [ 'error', 'after', { 277 | overrides: { 278 | '?': 'before', 279 | ':': 'before', 280 | '|>': 'before' 281 | } 282 | } ], 283 | '@stylistic/padded-blocks': 'off', 284 | '@stylistic/quote-props': [ 'error', 'as-needed' ], 285 | '@stylistic/quotes': [ 'warn', 'single' ], 286 | '@stylistic/rest-spread-spacing': [ 'error', 'never' ], 287 | '@stylistic/semi': [ 'error', 'always' ], 288 | '@stylistic/semi-spacing': [ 'error', { 289 | before: false, 290 | after: true 291 | } ], 292 | '@stylistic/space-before-blocks': [ 'error', 'always' ], 293 | '@stylistic/space-before-function-paren': 'off', 294 | '@stylistic/space-in-parens': [ 'error', 'never' ], 295 | '@stylistic/space-infix-ops': 'error', 296 | '@stylistic/space-unary-ops': [ 'error', { 297 | words: true, 298 | nonwords: false 299 | } ], 300 | '@stylistic/spaced-comment': [ 'error', 'always', { 301 | line: { markers: [ '*package', '!', '/', ',', '=' ] }, 302 | block: { 303 | balanced: true, 304 | markers: [ '*package', '!', ',', ':', '::', 'flow-include' ], 305 | exceptions: [ '*' ] 306 | } 307 | } ], 308 | '@stylistic/template-curly-spacing': [ 'error', 'never' ], 309 | '@stylistic/template-tag-spacing': [ 'error', 'never' ], 310 | '@stylistic/wrap-iife': [ 'error', 'any', { functionPrototypeMethods: true } ], 311 | '@stylistic/yield-star-spacing': [ 'error', 'both' ] 312 | } 313 | }, 314 | { 315 | // Do not warn about line length in Vue files, already handled by vue/max-len 316 | ignores: [ '**/*.vue' ], 317 | rules: { 318 | '@stylistic/max-len': [ 'warn', { 319 | code: 90, 320 | ignoreRegExpLiterals: true, 321 | ignoreTemplateLiterals: true, 322 | ignoreStrings: true, 323 | ignoreUrls: true 324 | } ] 325 | } 326 | }, 327 | { 328 | files: [ '**/*.vue' ], 329 | rules: { 330 | 'vue/max-len': [ 'warn', { 331 | code: 90, 332 | ignoreRegExpLiterals: true, 333 | ignoreTemplateLiterals: true, 334 | ignoreStrings: true, 335 | ignoreUrls: true, 336 | ignoreHTMLAttributeValues: true, 337 | ignoreHTMLTextContents: true 338 | } ] 339 | } 340 | }, 341 | { 342 | files: [ '**/ui/**/*.js', '**/*.vue' ], 343 | languageOptions: { 344 | globals: { 345 | ...globals.browser, 346 | apos: 'readonly' 347 | } 348 | }, 349 | rules: { 350 | 'no-console': 'error' 351 | } 352 | }, 353 | { 354 | files: [ 'test/**/*.js', '**/*.cy.js' ], 355 | languageOptions: { 356 | globals: { 357 | ...globals.mocha 358 | } 359 | }, 360 | rules: { 361 | 'no-console': 'error' 362 | } 363 | } 364 | ]); 365 | --------------------------------------------------------------------------------