Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

120 changes: 0 additions & 120 deletions .eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Gruntfile for music21j
// Copyright Michael Scott Asato Cuthbert (michael.asato.cuthbert@gmail.com), BSD License

// this system is in the process of being phased out in 2025 but is not there yet.

const path = require('path');
const webpack = require('webpack');
const ESLintPlugin = require('eslint-webpack-plugin');
Expand Down Expand Up @@ -66,7 +69,7 @@ module.exports = grunt => {
presets: babel_presets,
plugins: [
'@babel/plugin-transform-object-assign',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-transform-export-namespace-from',
'@babel/plugin-proposal-class-properties',
],
},
Expand Down Expand Up @@ -201,9 +204,6 @@ module.exports = grunt => {
},
eslint: {
target: SOURCES.concat(TEST_SOURCES),
options: {
overrideConfigFile: '.eslintrc.json',
},
},
qunit: {
files: ['tests/gruntTest.html'],
Expand Down
144 changes: 144 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
// keeping this as a commonJS file for now -- PyCharm goes crazy if we make it a .mjs file -- thinks
// everything ending in js is then one.
const globals = require('globals');
const { configs: airbnb } = require('eslint-config-airbnb-extended/legacy');
const eslint_parser = require('@typescript-eslint/parser');
const eslint_plugin = require('@typescript-eslint/eslint-plugin');

const no_unused_vars_config = [
'warn',
{
args: 'none',
caughtErrors: 'none',
varsIgnorePattern: '^_.*|^i$|^j$|^unused|^junk|^counter',
},
];


module.exports = [
...airbnb.base.recommended, // this is the flat-eslint version of airbnb-base
{
ignores: ['releases/*', 'build/*', 'node_modules/*'],
files: ['**/*.js', '**/*.ts'], // tsx would go here, etc.
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.browser,
...globals.jquery,
...globals.es2026, // this should be the latest in globals, not what we transpile to.
},
},
rules: {
'array-bracket-spacing': ['off'],
'arrow-body-style': ['off'],
'arrow-parens': ['off'],
'brace-style': ['off'],
'camelcase': ['off'],
'class-methods-use-this': ['off'],
'comma-dangle': ['warn', {
arrays: 'only-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
}],
'curly': ['warn', 'all'],
'dot-location': ['warn', 'property'],
'dot-notation': ['error'],
'function-paren-newline': ['warn', 'consistent'],
'indent': ['warn', 4, {
ignoredNodes: ['TemplateLiteral *'],
}],
'import/extensions': ['off'],
'import/prefer-default-export': ['off'],
'import/no-named-as-default': ['off'],
'import/no-named-as-default-member': ['off'],
'import/no-unresolved': ['off'],
'import/no-extraneous-dependencies': ['off'],
'linebreak-style': ['off'],
'lines-between-class-members': ['warn', 'always', {
exceptAfterSingleLine: true,
}],
'max-classes-per-file': ['off'],
'max-len': [
'warn', {
code: 120,
ignoreUrls: true,
ignoreTemplateLiterals: true,
ignoreTrailingComments: true,
},
],
'new-cap': ['off'],
'no-case-declarations': ['error'],
'no-console': ['off'],
'no-continue': ['off'],
'no-confusing-arrow': ['off'],
'no-else-return': ['off'],
'no-floating-decimal': ['warn'],
'no-lonely-if': ['off'],
'no-mixed-operators': ['off'],
'no-multi-spaces': ['off'],
'no-multiple-empty-lines': ['warn', { max: 3 }],
'no-param-reassign': ['off'],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-promise-executor-return': ['off'],
'no-restricted-syntax': [
2,
'DebuggerStatement',
'LabeledStatement',
'WithStatement',
],
'no-return-assign': ['warn', 'except-parens'],
'no-shadow': ['off'],
'no-trailing-spaces': ['off'],
'no-use-before-define': ['off'],
'no-underscore-dangle': ['off'],
'no-unused-vars': no_unused_vars_config,
'no-useless-return': ['warn'],
'object-curly-spacing': ['off'],
'object-curly-newline': ['warn', {
ObjectExpression: { multiline: true, minProperties: 5, consistent: true },
ObjectPattern: { multiline: true, minProperties: 5, consistent: true },
ImportDeclaration: { multiline: true, minProperties: 5, consistent: true },
ExportDeclaration: { multiline: true, minProperties: 5, consistent: true },
}],
'object-property-newline': ['off'],
'object-shorthand': ['off'],
'operator-linebreak': ['off'],
'padded-blocks': ['off'],
'prefer-const': [
'warn',
{
'destructuring': 'all',
}
],
'prefer-destructuring': ['off'],
'prefer-object-spread': ['warn'],
'prefer-regex-literals': ['off'],
'prefer-template': ['off'],
'quote-props': ['off'],
'quotes': ['warn'],
'radix': ['off'],
'semi-style': ['warn'],
'space-infix-ops': ['off'],
'spaced-comment': ['off'],
'strict': ['error', 'global'],
'yoda': ['error', 'never', { exceptRange: true }],
},
},
{
// formerly "overrides"
files: ['**/*.ts'],
plugins: {
'@typescript-eslint': eslint_plugin,
},
languageOptions: {
parser: eslint_parser,
},
rules: {
'@typescript-eslint/no-unused-vars': no_unused_vars_config,
'no-undef': 'off',
'no-unused-vars': 'off',
},
},
];
Loading