Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous cleanup #177

Merged
merged 4 commits into from
Mar 18, 2024
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
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.js]
[*.{js,mjs,cjs,ts}]
indent_style = space
indent_size = 2
max_line_length = 140
quote_type = single

[*.py]
indent_style = space
Expand Down
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

38 changes: 29 additions & 9 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import ts from 'typescript-eslint';

import jsoncParser from 'jsonc-eslint-parser';

import prettierPlugin from 'eslint-plugin-prettier';
import importPlugin from 'eslint-plugin-import';

import prettierConfig from 'eslint-config-prettier';
/* includes the plugin and enables the rules */
import prettierRecommendedConfig from 'eslint-plugin-prettier/recommended';

import globals from 'globals';

Expand Down Expand Up @@ -40,25 +40,33 @@ export default ts.config(
js.configs.recommended,
...ts.configs.strictTypeChecked,
...airbnbCompat,
prettierConfig,
prettierRecommendedConfig,
{
/* all JS/TS files */
files: ['**/*.{js,mjs,cjs,ts}'],
linterOptions: {
/* disable for now */
// reportUnusedDisableDirectives: 'warn',
},
plugins: {
prettier: prettierPlugin,
import: importPlugin,
},
rules: {
'prettier/prettier': ['error'],
'prettier/prettier': [
'error',
{
trailingComma: 'all',
},
],
/* allow names that start with _ to be unused */
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
/* varsIgnorePattern affects catch as well */
varsIgnorePattern: '^_',
},
],
Expand Down Expand Up @@ -115,7 +123,7 @@ export default ts.config(
},
},
{
files: ['services/**/*.{js,ts}', 'tools/*.js', 'eslint.config.{js,cjs,mjs}', 'webpack.config.js'],
files: ['services/**/*.{js,ts}', 'tools/*.js', 'eslint.config.{js,mjs,cjs}', 'webpack.config.js'],
/* all of these use node */
languageOptions: {
globals: {
Expand All @@ -140,13 +148,18 @@ export default ts.config(
},
{
files: ['tools/*.js'],
languageOptions: {
/* these scripts run during build, so they can use recent Node.js */
ecmaVersion: 'latest',
sourceType: 'script',
},
rules: {
/* not sure how to tell it these aren't modules */
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.config.{js,cjs,mjs}'],
files: ['*.config.{js,mjs,cjs}'],
rules: {
/* obviously we need dev dependencies */
'import/no-extraneous-dependencies': [
Expand All @@ -159,7 +172,7 @@ export default ts.config(
},
},
{
files: ['eslint.config.{js,cjs,mjs}'],
files: ['eslint.config.{js,mjs,cjs}'],
rules: {
/* necessary for flat config */
'import/no-default-export': 'off',
Expand All @@ -171,4 +184,11 @@ export default ts.config(
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['babel.config.json', 'tsconfig.json'],
rules: {
/* has various issues (e.g., forcing arrays/objects onto a single line) */
'prettier/prettier': 'off',
},
},
);
12 changes: 6 additions & 6 deletions frontend/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
Define your enyo/Application kind in this file.
Define your enyo/Application kind in this file.
*/

var
kind = require('enyo/kind'),
Application = require('enyo/Application'),
MainView = require('./views/MainView');
kind = require('enyo/kind'),
Application = require('enyo/Application'),
MainView = require('./views/MainView');

module.exports = kind({
kind: Application,
view: MainView
kind: Application,
view: MainView
});
6 changes: 3 additions & 3 deletions frontend/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
Instantiate your enyo/Application kind in this file. Note, application
rendering should be deferred until the DOM is ready by wrapping it in a
call to ready().
Instantiate your enyo/Application kind in this file. Note, application
rendering should be deferred until the DOM is ready by wrapping it in a
call to ready().
*/

var
Expand Down
Loading